-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
minikube running on google cloud shell is unable to pull image from artifact registry - denied: Unauthenticated request #19668
Comments
anant-ca do you mind trying "gcloud auth login" in cloud shell and see if that fixes the problem (and then enable the gcp-auth addon ) minikube addons enable gcp-auth |
@medyagh thanks for your prompt response. I tried your suggestion but it didn't solve the problem (minikube logs contain the same error as mentioned above). Here's the console output for your reference: anant@cloudshell:~/gh/deploy (sample-dev-434415)$ gcloud auth login
You are already authenticated with gcloud when running
inside the Cloud Shell and so do not need to run this
command. Do you wish to proceed anyway?
Do you want to continue (Y/n)? y
Go to the following link in your browser, and complete the sign-in prompts:
...
anant@cloudshell:~/gh/deploy (sample-dev-434415)$ gcloud auth list
Credentialed Accounts
ACTIVE: *
ACCOUNT: [email protected]
To set the active account, run:
$ gcloud config set account `ACCOUNT`
anant@cloudshell:~/gh/deploy (sample-dev-434415)$ minikube start
😄 minikube v1.33.1 on Ubuntu 22.04 (amd64)
▪ MINIKUBE_FORCE_SYSTEMD=true
▪ MINIKUBE_HOME=/google/minikube
▪ MINIKUBE_WANTUPDATENOTIFICATION=false
✨ Automatically selected the docker driver. Other choices: none, ssh
📌 Using Docker driver with root privileges
👍 Starting "minikube" primary control-plane node in "minikube" cluster
🚜 Pulling base image v0.0.44 ...
💾 Downloading Kubernetes v1.30.0 preload ...
> gcr.io/k8s-minikube/kicbase...: 481.58 MiB / 481.58 MiB 100.00% 79.67 M
> preloaded-images-k8s-v18-v1...: 342.90 MiB / 342.90 MiB 100.00% 40.98 M
🔥 Creating docker container (CPUs=2, Memory=4000MB) ...
🐳 Preparing Kubernetes v1.30.0 on Docker 26.1.1 ...
▪ kubelet.cgroups-per-qos=false
▪ kubelet.enforce-node-allocatable=""
▪ Generating certificates and keys ...
▪ Booting up control plane ...
▪ Configuring RBAC rules ...
🔗 Configuring bridge CNI (Container Networking Interface) ...
🔎 Verifying Kubernetes components...
▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟 Enabled addons: storage-provisioner, default-storageclass
🏄 Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
anant@cloudshell:~/gh/deploy (sample-dev-434415)$ minikube addons enable gcp-auth
💡 gcp-auth is an addon maintained by Google. For any concerns contact minikube on GitHub.
You can view the list of minikube maintainers at: https://github.com/kubernetes/minikube/blob/master/OWNERS
❗ It seems that you are running in GCE, which means authentication should work without the GCP Auth addon. If you would still like to authenticate using a credentials file, use the --force flag.
anant@cloudshell:~/gh/deploy (sample-dev-434415)$ kubectl apply -k k8/config/app/user/
namespace/user created
configmap/user-config created
service/user-service created
deployment.apps/user-deployment created
horizontalpodautoscaler.autoscaling/user-hpa created
anant@cloudshell:~/gh/deploy (sample-dev-434415)$ kubectl get all -n user
NAME READY STATUS RESTARTS AGE
pod/user-deployment-999854dbc-jtsr4 0/1 ErrImagePull 0 28s
pod/user-deployment-999854dbc-rmn4w 0/1 ErrImagePull 0 28s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/user-service LoadBalancer 10.109.100.15 <pending> 8080:31890/TCP 28s
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/user-deployment 0/2 2 0 28s
NAME DESIRED CURRENT READY AGE
replicaset.apps/user-deployment-999854dbc 2 2 0 28s
NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE
horizontalpodautoscaler.autoscaling/user-hpa Deployment/user cpu: <unknown>/80% 2 20 0 28s
|
@anant-ca I see , are you sure you are pulling image from Google AR ? or is that "GitHub Container Registry" I think that would require a different auth creds and would need to login to github |
@medyagh You are right the AR
|
Hi @anant-ca, I think the issue you're experiencing make sense. You have your Docker instance on your host machine authenticated with GitHub Container Registry, but when you start minikube it has its own Docker instance that created and running inside of it and that instance is trying to pull the images, and it isn't authenticated with GitHub Container Registry. We have an addon How did you authenticate with GitHub Container Registry? If you followed: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-with-a-personal-access-token-classic You should be able to run |
Hi @spowelljr and @medyagh ,
The key was to use the
You can see that the warning message is misleading. It clearly said that the addon is NOT required in GCE. Wondering if this warning can be removed so that the beginners like me don't get confused. |
What Happened?
I am running minikube on google cloud shell. When I deploy my app using a command
the deployment is unable to pull image from artefact registry. This is the error I receive:
Please note the following:
Attach the log file
log.txt
Operating System
Ubuntu
Driver
Docker
The text was updated successfully, but these errors were encountered: