Skip to content

Instantly share code, notes, and snippets.

@mike-weiner
Created September 26, 2025 19:57
Show Gist options
  • Select an option

  • Save mike-weiner/2277da033deef9652cb6a44f4e567e65 to your computer and use it in GitHub Desktop.

Select an option

Save mike-weiner/2277da033deef9652cb6a44f4e567e65 to your computer and use it in GitHub Desktop.
Instructions for creating a Kubernetes Docker Configuration secret to pull container images from a private registry.
# Optional: Delete Existing Registry Credential
kubectl delete secrets -n <NAMESPACE> <SECRET-NAME>
# Create Docker Config Secret
kubectl create secret generic -n <NAMESPACE> <SECRET-NAME> \
--type=kubernetes.io/dockerconfigjson \
--from-file=.dockerconfigjson=/path/to/config.json
# /path/to/config.json should be in the format shown below.
# [REDACTED] should be your base64 encoded credentials.
# Docker stores this file at: ~/.docker/config.json
# Podman stores this file at: .config/containers/auth.json
#
#
# {
# "auths": {
# "myprivate-registry.io": {
# "auth": "[REDACTED]"
# }
# }
# }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment