【发布时间】:2020-03-27 15:49:40
【问题描述】:
我是 Kubernetes 新手,作为我自己的教程,我一直致力于使用 helm (v3) 将一个基本项目部署到 Kubernetes。 我在 AWS 的 ECR 中有一张图片以及该项目的本地掌舵图。 但是,我正在努力使用 Kubernetes 运行我的映像。
我的图像设置正确。如果我在本地尝试docker run my_image_in_ecr 之类的操作,它的行为将按预期进行(在本地配置我的 IAM 访问凭证之后)。
我的掌舵图已正确处理,并且在我的图像地图中,它指定:
image:
repository: my_image_in_ecr
tag: latest
pullPolicy: IfNotPresent
当我尝试使用 helm 进行部署时,我遇到了问题。 我的理解是用helm运行我的程序,我应该:
在我的图表上运行 helm install
在我的新 kubernetes pod 中运行映像
但是当我查看我的 kubernetes pod 时,它们似乎永远不会启动和运行。
hello-test1-hello-world-54465c788c-dxrc7 0/1 ImagePullBackOff 0 49m
hello-test2-hello-world-8499ddfb76-6xn5q 0/1 ImagePullBackOff 0 2m45s
hello-test3-hello-world-84489658c4-ggs89 0/1 ErrImagePull 0 15s
这些 pod 的日志如下所示:
Error from server (BadRequest): container "hello-world" in pod "hello-test3-hello-world-84489658c4-ggs89" is waiting to start: trying and failing to pull image
由于我不知道如何使用 Kubernetes 正确设置 imagePullSecrets,我预计这会失败。但我期待一个不同的错误消息,例如错误的身份验证凭据。
【问题讨论】:
-
检查这是否对您有帮助,medium.com/@xynova/…
标签: amazon-web-services docker kubernetes kubernetes-helm kubectl