第1步 sudo $(aws ecr get-login --no-include-email --region xx-xxxx-x)
第2步 curl -LSs https://github.com/fermayo/ecr-k8s-secret/raw/master/gen-secret.sh | bash -
第 3 步 kubectl describe secret aws-ecr-credentials
Name: aws-ecr-credentials
Namespace: default
Labels: <none>
Annotations: <none>
Type: kubernetes.io/dockerconfigjson
Data
.dockerconfigjson: 32 bytes
Run Code Online (Sandbox Code Playgroud)
第四步 kubectl describe pod x
警告 5s kubelet 失败,ip-10-46-250-151 无法拉取映像“my-account.dkr.ecr.us-east-1.amazonaws.com/my-image:latest”:rpc 错误:代码 = 未知desc = 来自守护进程的错误响应:获取https://my-account.dkr.ecr.us-east-1.amazonaws.com/my-image/latest:没有基本的身份验证凭据
为什么pod拉不下图片?