According to this document


one could create a docker registry by running:

kubectl create secret docker-registry regcred \
--docker-server=<your-registry-server> \
--docker-username=<your-name> \
--docker-password=<your-pword> --docker-email=<your-email>

How to create a secret without entering the password as plain text?

1 Answer 1


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 \

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.