我从昨天就遇到这个问题,之前没有问题。
我的环境是
minikube start
Run Code Online (Sandbox Code Playgroud)
kubectl get po -A
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-64897985d-z7rpf 1/1 Running 0 22s
kube-system etcd-minikube 1/1 Running 1 34s
kube-system kube-apiserver-minikube 1/1 Running 1 34s
kube-system kube-controller-manager-minikube 1/1 Running 1 33s
kube-system kube-proxy-zdr9n 1/1 Running 0 22s
kube-system kube-scheduler-minikube 1/1 Running 1 34s
kube-system storage-provisioner 1/1 Running 0 29s
Run Code Online (Sandbox Code Playgroud)
istioctl manifest apply -y
Run Code Online (Sandbox Code Playgroud)
kubectl get po …
Run Code Online (Sandbox Code Playgroud) 根据下面的文章,我们似乎可以将容器映像从 ArtifactRegistry 拉取到 GKE,而无需任何额外的身份验证(当它们位于同一项目中时)。
https://cloud.google.com/artifact-registry/docs/integrate-gke
https://www.youtube.com/watch?v=BfS7mvPA-og
GKE 出现错误:ImagePullBackOff 和错误:ErrImagePull 错误
但当我尝试时,我遇到了ImagePullBackOff
错误。
有没有什么错误?误解?或者我应该使用其他身份验证吗?
在https://console.cloud.google.com上的某些项目中使用 Google Cloud Shell 很方便。
gcloud artifacts repositories create test \
--repository-format=docker \
--location=asia-northeast2
Run Code Online (Sandbox Code Playgroud)
gcloud auth configure-docker asia-northeast2-docker.pkg.dev
docker pull nginx
docker tag nginx asia-northeast2-docker.pkg.dev/${PROJECT_NAME}/test/sample-nginx-image
docker push asia-northeast2-docker.pkg.dev/${PROJECT_NAME}/test/sample-nginx-image
Run Code Online (Sandbox Code Playgroud)
使用 GUI 控制台创建 GKE Autopilot 集群。
几乎所有选项都是默认的,但我更改了这两个。
gcloud container clusters get-credentials test --zone asia-northeast2
kubectl run test …
Run Code Online (Sandbox Code Playgroud) kubernetes google-kubernetes-engine google-artifact-registry autopilot