How to set passwords in configmap

I want to configure passwords in the config map.YAML instead of deployment.yaml.able to set username and other variables.attcahing the config map.YAML file which I worked on.

kind: ConfigMap
apiVersion: v1
metadata:
  name: poc-configmapconfiguration-configmap
    data:
      Environment: [[.Environment]]
      dockerRegistryUrl: [[.Env.dockerRegistryUrl]]
      CassandraSettings__CassandraPassword:
              valueFrom:
                secretKeyRef:
                  name: abcd-passwords
                  key: "[[ .Environment ]]-abcd-cassandra-password

Source: StackOverflow