Kubernetes Failed to pull image no basic auth credentials Kubernetes Failed to pull image no basic auth credentials kubernetes kubernetes

Kubernetes Failed to pull image no basic auth credentials


The secret have to be in the same namespace as the deployment to be able to use it to pull from the docker registry.
So when you create the secret, you use:

kubectl create secret docker-registry regcred \  --namespace=jhipster \ # <--  --docker-server=docker.pkg.github.com \  --docker-username=********* \  --docker-password=******* \  --docker-email=*****

It might also be an issue if you use 2fa and password (in the regcred), in which case you aught to create an access token to use as password instead.


For me, I had to add a https:// to the docker-serveri.e.

kubectl create secret docker-registry aws-secret --docker-server=https://AWS@311730556533.dkr.ecr.ca-central-1.amazonaws.com --docker-username=AWS --docker-password=$PASSWORD -n NAMESPACE```