【发布时间】:2018-06-17 18:28:52
【问题描述】:
知道为什么我总是收到这个烦人且无用的错误代码/描述吗?
Failed to pull image myapidemodocker.azurecr.io/apidemo:v4.0: rpc error: code = Unknown desc = unknown blob
我想到了不正确的秘密,并按照微软的这个文档没有成功! [https://docs.microsoft.com/en-us/azure/container-registry/container-registry-auth-aks][1].
上下文:
- 我正在使用 Visual Studio 和 Docker for Windows 来创建 Windows 容器图像。
- 映像被推送到 Azure 容器注册 (ACR) 并部署为 Azure 容器实例。不幸的是,我不能将 ACI 用作 生产应用程序,因为它没有连接到私有 vNET。 出于安全原因,不能使用公共 IP,但这就是我们所做的 为 poc!
- 下一步,在 Azure 中创建 Kubernetes 集群并尝试部署 将相同的图像(Windows 容器)放入 Kubernetes POD,但不是 工作。
- 让我分享一下我的 yml 定义和事件日志
这是我的 yml 定义:
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: apidemo
spec:
template:
metadata:
labels:
app: apidemo
spec:
containers:
- name: apidemo
image: myapidemodocker.azurecr.io/apidemo:v4.0
imagePullSecrets:
- name: myapidemosecret
nodeSelector:
beta.kubernetes.io/os: windows
Event logs:
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 4m default-scheduler Successfully assigned apidemo-57b5fc58fb-zxk86 to aks-agentp
ool-18170390-1
Normal SuccessfulMountVolume 4m kubelet, aks-agentpool-18170390-1 MountVolume.SetUp succeeded for volume "default-token-gsjhl"
Normal SandboxChanged 2m kubelet, aks-agentpool-18170390-1 Pod sandbox changed, it will be killed and re-created.
Normal Pulling 2m (x2 over 4m) kubelet, aks-agentpool-18170390-1 pulling image "apidemodocker.azurecr.io/apidemo:v4.0"
Warning Failed 20s (x2 over 2m) kubelet, aks-agentpool-18170390-1 Failed to pull image "apidemodocker.azurecr.io/apidemo:v4
.0": [rpc error: code = Unknown desc = unknown blob, rpc error: code = Unknown desc = unknown blob]
Warning Failed 20s (x2 over 2m) kubelet, aks-agentpool-18170390-1 Error: ErrImagePull
Normal BackOff 10s kubelet, aks-agentpool-18170390-1 Back-off pulling image "apidemodocker.azurecr.io/apidemo:
v4.0"
Warning Failed 10s kubelet, aks-agentpool-18170390-1 Error: ImagePullBackOff
(5) 我不明白为什么 Kubernetes 仍然使用来自 default-token-gsjhl 的 /var/run/secrets/kubernetes.io/serviceaccount 作为秘密,而我指定了我自己的!
感谢您抽出宝贵时间提供反馈。
【问题讨论】:
标签: azure kubernetes