Kubernetes:无法从私有容器注册表中提取映像
Kubernetes: Failed to pull image from private container registry
我正在使用 Azure 进行持续部署,我的秘密名称是“cisecret”使用
kubectl create secret docker-registry cisecret --docker-username=XXXXX --docker-password=XXXXXXX --docker-email=SomeOne@outlook.com --docker-server=XXXXXXXXXX.azurecr.io
在我的Visual Studio在线发布任务中
kubectl 运行
在 Secrets 部分下
秘密类型:dockerRegistry
容器注册表类型:Azure 容器注册表
秘密名称:cisecret
我的发布成功了,但是当代理到kubernetes时
Failed to pull image xxxxxxx unauthorized: authentication required.
这应该有帮助,您需要使用 "imagepullsecrets":"cisecret".
覆盖 kubectl 命令
这可能是由于您的容器名称造成的吗?我遇到了一个问题,我没有在我的 Kubernetes YAML 中的图像名称前面正确地添加 ACR 域,这意味着我没有指向容器注册表/图像,因此我的秘密(正在工作)似乎被打破了.
你能post你的 YAML 吗?也许有一些简单的错误,因为从秘密的角度来看,你似乎在正确的轨道上。
我需要授予 AKS 访问 ACR 的权限。
请参考linkhere
在yaml文件中添加以下内容。
imagePullSecrets:
- 名称:acr-auth
我正在使用 Azure 进行持续部署,我的秘密名称是“cisecret”使用
kubectl create secret docker-registry cisecret --docker-username=XXXXX --docker-password=XXXXXXX --docker-email=SomeOne@outlook.com --docker-server=XXXXXXXXXX.azurecr.io
在我的Visual Studio在线发布任务中
kubectl 运行
在 Secrets 部分下
秘密类型:dockerRegistry
容器注册表类型:Azure 容器注册表
秘密名称:cisecret
我的发布成功了,但是当代理到kubernetes时
Failed to pull image xxxxxxx unauthorized: authentication required.
这应该有帮助,您需要使用 "imagepullsecrets":"cisecret".
覆盖 kubectl 命令这可能是由于您的容器名称造成的吗?我遇到了一个问题,我没有在我的 Kubernetes YAML 中的图像名称前面正确地添加 ACR 域,这意味着我没有指向容器注册表/图像,因此我的秘密(正在工作)似乎被打破了.
你能post你的 YAML 吗?也许有一些简单的错误,因为从秘密的角度来看,你似乎在正确的轨道上。
我需要授予 AKS 访问 ACR 的权限。
请参考linkhere
在yaml文件中添加以下内容。 imagePullSecrets: - 名称:acr-auth