K8s pull image from private Docker registry
Last updated
Was this helpful?
Last updated
Was this helpful?
This article will show you how various methods utilizing CloudTruth and to create a Kubernetes Secret that allows you to create pods that use this Secret to or repository.
Method 1:
Method 2:
Method 3:
run docker login
base64 encode your
base64 /home/$USER/.docker/config.json
Add the config.json base64 encoded string as a CloudTruth parameter type:secret
named configjson
in a CloudTruth project called K8s.
Create a CloudTruth template regcred
and if required the yaml to your namespace.
Run kubectl apply -f <(cloudtruth --project K8s template get regcred)
You can now and . kubectl get secret myregistrykey --output=yaml
run docker login
base64 /home/$USER/.docker/config.json
Add the config.json base64 encoded string as a CloudTruth parameter type:secret
named configjson
in a CloudTruth project called K8s
.
Create a KubeTruth override in the namespace where KubeTruth is operating that will automatically create the K8s kubernetes.io/dockerconfigjson
Secret.
Create a dedicated CloudTruth project named dockerconfigure
that contains the following docker login keys and values.
Create the KubeTruth override below in the namespace where KubeTruth is operating. This will automatically base64 encode and create the K8s kubernetes.io/dockerconfigjson
Secret based on your docker login and registry information in the CloudTruth project.
base64 encode your
You can now and . kubectl get secret docker-reg-cred --output=yaml -n demokubetruth
You can now and . kubectl get secret docker-reg-cred --output=yaml -n demokubetruth