kubectl create secret docker-registry regcred --docker-server=ghcr.io --docker-username=barry --docker-password=ch4nge-me

Category: Kubernetes & Containers

kubectl create secret docker-registry regcred --docker-server=ghcr.io --docker-username=barry --docker-password=ch4nge-me

Create a registry pull secret

Creates a secret of type kubernetes.io/dockerconfigjson so nodes can pull images from a private registry. Reference it in a pod spec via imagePullSecrets. The password sits in the secret base64-encoded, so rotate it if it leaks.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.