拉动图像时更改Kubernetes的平台
我正在使用Apple M1,编写kubernetes yaml文件来拉动和部署图像confluentinc/cp-zookeeper:6.2.4
问题是,由于CPU架构的差异,我无法拉出图像
Failed to pull image "confluentinc/cp-zookeeper:6.2.4": rpc error: code = Unknown desc = no matching manifest for linux/arm64/v8 in the manifest list entries
使用Docker-Compose时,我只能指定标签平台:linux/x86_64
,并且一切都如正常一样,但是我不确定如何为K8S执行此操作,我尝试设置环境变量docker_default_platform
,但也无法正常工作。
我正在使用docker-desktop内置的kubernetes
I am using an Apple M1, writing a Kubernetes YAML file to pull and deploy the image confluentinc/cp-zookeeper:6.2.4
the problem is, I cannot pull the image due to the difference in CPU architecture
Failed to pull image "confluentinc/cp-zookeeper:6.2.4": rpc error: code = Unknown desc = no matching manifest for linux/arm64/v8 in the manifest list entries
When using docker-compose, I can just specify the tag platform: linux/x86_64
and everything goes as normal, but I'm not sure how to do this for K8S, I have tried to set the environment variable DOCKER_DEFAULT_PLATFORM
as well but it's not working either.
I'm using Docker-Desktop's built in Kubernetes
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我所知,POD/部署没有选择来定义架构。
我认为,如果指向容器图像上下文,Kubernetes将自动提取正确的图像。当您只有没有索引的单个图像时,就必须与NodeSelectors或其他内容一起工作,然后将CPU架构固定在图像标签上( https://kubernetes.io/docs/concepts/concepts/containers/containers/images/#multi-achitection-unmages/#multi-architecture-images-with-images-with-image-image-image-image-image-indexes < /a>)。
在您的问题中给定的图像:
我认为,在这种情况下,
Confluentinc/cp-zookeeper
在Docker Hub中具有ARM64图像,但没有ARM64/V8图像。现在,我不知道M1上Docker的内部。但是我有点惊讶X86_64甚至在ARM CPU上工作。
As I know there is no option for Pods/Deployments to define an architecture.
I assume, that Kubernetes will automatically pull the correct image if you point to a Container image context. When you have only single images without an index then you have to work with nodeSelectors or something else and to pin the CPU architecture over the image tag (https://kubernetes.io/docs/concepts/containers/images/#multi-architecture-images-with-image-indexes).
To your given image in your question:
In this case, I think, is the issue that
confluentinc/cp-zookeeper
has a ARM64 image in Docker Hub but no ARM64/v8 image.Now I don't know the internals of Docker on M1. But I am a bit surprised that x86_64 even work on an ARM CPU.
只是只能使用图像摘要,例如
&lt; image-name&gt;@@&lt; imp;
just can only use image digest, like
<image-name>@<digest>
https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy