gpt4 book ai didi

docker - 有没有办法在 Kubernetes 上缓存加载的图像

转载 作者:行者123 更新时间:2023-12-02 20:46:22 27 4
gpt4 key购买 nike

我将图像(.tar)加载到本地 docker 存储库中,然后 Kubernetes 将该图像拉入容器中。应用程序启动并运行后,我想从本地 docker 存储库中删除该镜像,这是正确的方式还是 Kubernetes 仍需要 docker 本地存储库中的该镜像?
我在删除该图像时进行了测试,我的应用程序仍然可以工作,但是如果我想放大或缩小,我遇到了一个问题,因为图像丢失了。

我想,如果 Pod 宕机了,Kubernetes 会在 docker 存储库中再次寻找 Image 吗?

有没有办法在 Kubernetes 中缓存该图像,所以不需要从 docker 存储库中再次拉取?

我想在 Kubernetes 上运行应用程序后立即删除这些图像的原因是安全性,我不想将我的图像留在 docker 存储库中,这样用户就无法提取该图像并将其导出到某个地方......

最佳答案

I presume, if the Pod goes down, Kubernetes will seek for Image again in docker repository?



是的。

Is there any way to cache that Image inside Kubernetes, so no need to pull again from docker repository?



当您拉取图像时,它会由 docker 或您的运行时管理器在本地缓存。

The reason why I want to delete these images right after Application run on Kubernetes is security, I don't want to leave my images inside docker repository so a user can't extract that image and export it somewhere...



如果您担心安全性,则不应将敏感信息(密码、凭据、 key )放在图像中。这就是为什么有 Kubernetes Secrets或像 Hashicorp Vault 这样的工具.

如果您担心知识产权的私密性,您应该考虑使用私有(private)容器镜像存储库或私有(private) Docker registry

关于docker - 有没有办法在 Kubernetes 上缓存加载的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52905048/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com