How to create a docker registry secret without passing the password on the command line? According to this document

https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/

one could create a docker registry by running:

kubectl create secret docker-registry regcred \
--docker-server=&lt;your-registry-server&gt; \
--docker-username=&lt;your-name&gt; \
--docker-password=&lt;your-pword&gt; --docker-email=&lt;your-email&gt;


How to create a secret without entering the password as plain text?
It is possible to create a secret without passing on the commandline by reading it from file:


$ kubectl create secret generic ssh-key-secret \
  --from-file=ssh-privatekey=/path/to/.ssh/id_rsa \
  --from-file=ssh-publickey=/path/to/.ssh/id_rsa.pub



See https://kubernetes.io/docs/concepts/configuration/secret/ for more information.