How to specify registry credentials on kubectl set image?

6/25/2019

I have a deployment that uses a private registry by the use of imagePullSecrets. It is running ok but when I try to update its image by specifying another tag like this:

kubectl set image deployment/mydeployment mycontainer=my_docker_hub_user/my_image:some_tag

my pod get a ImagePullBackOff status with the message:

Failed to pull image "my_docker_hub_user/my_image:some_tag": rpc error: code = Unknown desc = Error response from daemon: Get https://registry-1.docker.io/v2/my_docker_hub_user/my_image/manifests/some_tag: unauthorized: incorrect username or password

But I cannot find how to inform user and password

-- Eduardo
docker
kubernetes

1 Answer

6/25/2019

Kubernetes uses secrets to store the credentials to pull from a private docker registry. You can check out this guide to set it up properly as most likely the Secret defined in the imagePullSecrets does not have access to your new image. You need to define a Secret that has access to the private docker registry and update the deployment with the new imagePullSecrets.

-- Blokje5
Source: StackOverflow