标签:初始化 different 技术 cpu vmware虚拟机 check docker使用 UNC 新建
1、kubelet与docker驱动不一致(网上其他解决文案各种尝试无效,最后使用如下方法解决)异常描述如下:
failed to create kubelet: misconfiguration: kubelet cgroup driver: "cgroupfs" is different from docker cgroup driver: "systemd"
[root@master~]# cat /etc/docker/daemon.json
{
"registry-mirrors": ["https://b9pmyelo.mirror.aliyuncs.com"],
"exec-opts": ["native.cgroupdriver=systemd"]
}
2)修改/var/lib/kubelet/kubeadm-flags.env驱动配置,添加--cgroup-driver=systemd 参数
[root@master~]# cat /var/lib/kubelet/kubeadm-flags.env
KUBELET_KUBEADM_ARGS="--cgroup-driver=systemd --network-plugin=cni --pod-infra-container-image=registry.aliyuncs.com/google_containers/pause:3.1"
#重启docker与kubelet
[root@master~]# systemctl daemon-reload && systemctl restart docker kubelet
2、/system.slice/kubelet.service无法识别
异常描述如下
failed to get container info for "/system.slice/kubelet.service": unknown container "/system.slice/kubelet.service"
修改kubelet.service
[root@master~]# vim /lib/systemd/system/kubelet.service
#在ExecStart位置最后面,添加如下配置
--runtime-cgroups=/systemd/system.slice --kubelet-cgroups=/systemd/system.slice
3、kubeadm初始化时报[ERROR NumCPU]
kubeadm init --apiserver-advertise-address=10.10.10.129 --image-repository registry.aliyuncs.com/google_contain
ers --kubernetes-version v1.17.0 --service-cidr=10.96.0.0/12 --pod-network-cidr=10.244.0.0/16W0521 22:45:14.131024 8293 validation.go:28] Cannot validate kube-proxy config - no validator is available
W0521 22:45:14.131095 8293 validation.go:28] Cannot validate kubelet config - no validator is available
[init] Using Kubernetes version: v1.17.0
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR NumCPU]: the number of available CPUs 1 is less than the required 2
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
To see the stack trace of this error execute with --v=5 or higher
$ kubeadm init --apiserver-advertise-address=10.10.10.129 --image-repository registry.aliyuncs.com/google_containers --kubernetes-version v1.17.0 --service-cidr=10.96.0.0/12 --pod-network-cidr=10.244.0.0/16 --ignore-preflight-errors=NumCPU
标签:初始化 different 技术 cpu vmware虚拟机 check docker使用 UNC 新建
原文地址:https://blog.51cto.com/8355320/2497457