Kubernetes部署-容器未启动-错误-InvalidImageName。

12
以下是Kubernetes部署yaml文件的-container镜像部分:
image: https://registry.ng.bluemix.net/****/test-service:test-branch-67

imagePullPolicy: Always

部署后出现以下错误消息:

ubuntu@ip-xxxx:~$ kubectl logs test-deployment-69c6d8xxx -n test

来自服务器的错误(BadRequest):Pod “test-deployment-ccccxxx”中的容器“test-deployment”正在等待启动:InvalidImageName

另一个错误日志:

应用默认镜像标签“https://registry.ng.bluemix.net/test/test-service:test-branch-66”失败:无法解析镜像引用“https://registry.ng.bluemix.net/test/test-service:test-branch-66”:无效的引用格式

有什么想法,为什么Pod没有启动?


遇到了相同的问题,后来发现创建图像的管道失败了。 - Jalal
4个回答

11

从镜像名称中删除 https://,如果您正在使用私有仓库,请确保使用 imagePullSecrets


2
imagePullSecrets是什么意思? - Hvaandres

2
这可能是因为您的YAML文件中图像名称错误,可能缺少标签,您可以从那里进行跟踪。

0
请添加完整的部署文件以了解问题的详细信息。但是在查看文件时,请确保您没有遗漏以下内容:

imagePullSecrets(使用具有从存储库拉取镜像访问权限的有效凭据)

此外,您无需提供像您添加的

https

一样的协议。

yml中的图像字段应如下所示:

image:repository:organization_name/image_name:image_version


0

curl --insecure -sfL https://192.168.2.217/v3/import/zc2t5qstv4l9f6wv8stmfsqcks47x7z5m4xnnrbf7hn9c9vj65bwd7_c-4mdds.yaml  > tmp.yaml

# edit tmp.yaml file and delete https:/hub.docker.com/rancher/rancher-agent:v2.5.7 => rancher/rancher-agent:v2.5.7
# apply again:
kubectl apply -f tmp.yaml

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接