当我尝试使用 docker 注册表部署某些内容时,我每次都会看到错误:
x509: cannot validate certificate for 10.2.10.7 because it doesn't contain any IP SANs
问题:
如何禁用 ssl
将 Docker 注册表中的镜像部署到 Kubernetes?
最佳答案
假设宽松的安全性适合您的环境,在 Kubernetes 中实现您想要的一种方法是将 Docker 配置为连接到私有(private)注册表作为不安全的注册表。
根据 doc here :
With insecure registries enabled, Docker goes through the following steps:
- First, try using HTTPS. If HTTPS is available but the certificate is invalid, ignore the error about the certificate.
- If HTTPS is not available, fall back to HTTP.
请注意,该文档中描述的对 /etc/docker/daemon.json
的更改 - 添加“insecure-registries”配置 - 必须应用于 Kubernetes 集群中 pod 所在的所有节点/containers 可以安排运行。另外,必须重新启动 Docker 才能使更改生效。
还需要注意的是,上面假设集群使用 Docker 容器运行时,而不是支持 Docker 镜像格式和注册表的其他运行时(例如 CRI-O)。
关于Docker 在 Kubernetes 中使用 docker 私有(private)注册表拉取没有 ssl 的镜像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58603625/