小编akr*_*sum的帖子

Minikube 重启时总是重置为初始状态

我从昨天就遇到这个问题,之前没有问题。
我的环境是

  • 视窗11
  • Docker 桌面版 4.4.4
  • 迷你库贝 1.25.1
  • kubernetes-cli 1.23.3

复制

1.启动minikube并创建集群

minikube start
Run Code Online (Sandbox Code Playgroud)

2. 检查 Pod

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)

3.添加新的pod(本例中使用istio)

istioctl manifest apply -y
Run Code Online (Sandbox Code Playgroud)

4. 检查 Pod

kubectl get po …
Run Code Online (Sandbox Code Playgroud)

kubernetes minikube

6
推荐指数
1
解决办法
2434
查看次数

无法将容器映像从私有 Artifact Registry 拉取到 GKE Autopilot,即使这些映像位于同一项目中

根据下面的文章,我们似乎可以将容器映像从 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)

创建 GKE Autopilot 集群

使用 GUI 控制台创建 GKE Autopilot 集群。

几乎所有选项都是默认的,但我更改了这两个。

  • 将集群名称设置为 test。
  • 设置与注册表相同的区域。(在本例中为 asia-northeast2)
  • 启用 Anthos Service Mesh。

将容器映像从 Artifact Registry 部署到 GKE

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

2
推荐指数
1
解决办法
2697
查看次数