K8S篇之k8s containerd模式fail to pull image certificate signed by unknown authority

"k8s containerd模式fail to pull image certificate signed by unknown authority"的问题
解决方案:您有两个选择:配置证书或禁用证书验证。

配置证书:您可以为 containerd 配置证书,使其信任由未知机构签名的证书。
具体步骤如下:

找到未知机构签名的证书文件,确保证书文件是正确的并且是完整的。

在 Kubernetes worker 节点上找到 containerd 的配置文件,一般位于/etc/containerd/config.toml。

编辑 config.toml 文件,在 plugins."io.containerd.grpc.v1.cri".registry.mirrors."your_registry_domain".tls

1、部分添加以下内容:

复制代码

python 复制代码
ca_file = "/path/to/your_certificate_file.crt"

其中,your_registry_domain 是您的镜像仓库域名,/path/to/your_certificate_file.crt 是您证书文件的路径。

2、重启 containerd 服务以使更改生效

python 复制代码
systemctl restart containerd。

禁用证书:如果您希望完全禁用证书验证,可以进行以下操作:

在 Kubernetes worker 节点上找到 containerd 的配置文件,一般位于/etc/containerd/config.toml。

1、编辑 config.toml 文件,在 plugins."io.containerd.grpc.v1.cri".registry.mirrors."your_registry_domain".tls 部分添加以下内容:

python 复制代码
// 复制代码
insecure_skip_verify = true

其中,your_registry_domain 是您的镜像仓库域名。

2、重启 containerd 服务以使更改生效

python 复制代码
systemctl restart containerd

但请注意,禁用证书验证会导致容器镜像下载过程中忽略证书验证,可能会带来一定的安全风险。所以最好的做法是配置正确的证书来解决验证问题。

相关推荐
程序员老赵6 小时前
Docker 部署 Redmine:轻松搭建私有化项目管理平台
docker·容器·开源
小楼昨夜又东风1267 小时前
一文理清K8s PVC挂载完整流程
容器·rpc·kubernetes
阿里云云原生7 小时前
AgentLoop 审计:如何让企业级 Dify 应用的风险看得见、查得清
云原生·agent
Coisinier8 小时前
docker命令管理镜像及容器
linux·运维·nginx·docker·容器·操作系统
小猿姐8 小时前
KubeBlocks Enterprise v2.3 发布!
redis·kubernetes·aiops
阿里云云原生9 小时前
云栖实录丨云监控 2.0 让 Agent 看懂系统,也能看懂 Agent
云原生
东风微鸣12 小时前
如何发现 K8s 集群里的无用资源?
云原生·容器·kubernetes
恒拓高科WorkPlus12 小时前
私有化IM技术选型:商业平台、开源IM和IM PaaS怎么选?
云原生·开源·paas
flytalei12 小时前
从YAML到Nginx服务访问:动手理解 Kubernetes Pod、Deployment 与 Service
运维·nginx·kubernetes
木雷坞13 小时前
Docker Compose部署Docmost:数据库、附件持久化与首次协作
数据库·docker·容器