kubeadm init 等待超时问题

问题描述 配置master节点时,执行kubeadm init --config kubeadm-config.yaml --v=5命令后,执行至初始化Pod步骤时报错: [wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifests". This can take up to 4m0s [kubelet-check] Initial timeout of 40s passed. Unfortunately, an error has occurred: timed out waiting for the condition This error is likely caused by: - The kubelet is not running - The kubelet is unhealthy due to a misconfiguration of the node in some way (required cgroups disabled) ...... 经过检查,host配置无误,cluster的IP地址也与本机相同 ...

January 15, 2025

Docker配置阿里云镜像后仍报错问题

Kubernetes需要使用docker作为运行时,在Linux机器上安装docker后,尝试拉取hello-world镜像时出现问题 安装docker时一切都很顺利: sudo apt update sudo apt install docker.io sudo systemctl start docker sudo systemctl enable docker 但在进行docker pull hello-world拉取镜像时报错: Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceed ed while awaiting headers) 解决方法 首先需要更换docker源,这里使用阿里云镜像加速器与另一个自己收集的源。进入/etc/docker/daemon.json文件中如此配置: { "registry-mirrors": [ "https://ok5mwqnl.mirror.aliyuncs.com", "https://docker.1ms.run" ] } 配置完成后执行sudo systemctl restart docker重启docker服务 重启后运行docker pull hello-world仍失败,报错信息与先前一致 这时考虑DNS配置问题,进入/etc/resolv.conf文件,在原有的若干nameserver之上再增加两条: # Generated by NetworkManager nameserver 8.8.8.8 nameserver 8.8.4.4 # 此处为原有的若干行nameserver # ... 配置完成后运行docker pull hello-world,成功拉取镜像,执行sudo docker images查看本地镜像: ...

January 13, 2025