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

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

相关推荐
cyber_两只龙宝3 小时前
【Haproxy】Haproxy的算法详解及配置
linux·运维·服务器·云原生·负载均衡·haproxy·调度算法
火车叼位5 小时前
Docker Compose 网络原理与实战:同一 Compose 服务间如何稳定通信
运维·docker·容器
D愿你归来仍是少年8 小时前
Kubernetes(K8s)系统学习指南
容器·kubernetes
D愿你归来仍是少年9 小时前
Docker 深入学习指南
docker·容器
岁岁种桃花儿9 小时前
kubenetes从入门到上天系列第十九篇:Kubernetes安装Nginx ingress controller
java·nginx·kubernetes
阿里云云原生9 小时前
打通智能体孤岛:用 AgentRun 构建生产级 A2A 多 Agent 管理协作系统
云原生·agent
liliangcsdn9 小时前
centos7 docker镜像库国内加速
云原生·eureka
AI攻城狮10 小时前
长上下文不是长期记忆:为什么 1M Context 也不会淘汰 RAG
人工智能·云原生·aigc
馨谙10 小时前
Kubernetes 核心技术之 Namespace:资源隔离与环境管理全解析
容器·kubernetes
道清茗11 小时前
【Kubernetes知识点问答题】Pod
云原生·容器·kubernetes