当我们按照官网的步骤安装好 KubeEge 后,会发现 edge node 的状态为 NotReady
好了直接给答案吧 这里是因为 cgroup driver 导致的 , 我们统一成systemd
kubelet 配置 cgroup driver
# Note: This dropin only works with kubeadm and kubelet v1.11+
[Service]
Environment="KUBELET_KUBECONFIG_ARGS=--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf"
Environment="KUBELET_CONFIG_ARGS=--config=/var/lib/kubelet/config.yaml"
Environment="KUBELET_CGROUP_ARGS=--cgroup-driver=systemd --runtime-cgroups=/systemd/system.slice --kubelet-cgroups=/systemd/system.slice"
# This is a file that "kubeadm init" and "kubeadm join" generates at runtime, populating the KUBELET_KUBEADM_ARGS variable dynamically
EnvironmentFile=-/var/lib/kubelet/kubeadm-flags.env
# This is a file that the user can use for overrides of the kubelet args as a last resort. Preferably, the user should use
# the .NodeRegistration.KubeletExtraArgs object in the configuration files instead. KUBELET_EXTRA_ARGS should be sourced from this file.
EnvironmentFile=-/etc/sysconfig/kubelet
ExecStart=
ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS
没有就添加,有就改成这样, 改完了重启 kubelet
Environment="KUBELET_CGROUP_ARGS=--cgroup-driver=systemd --runtime-cgroups=/systemd/system.slice --kubelet-cgroups=/systemd/system.slice"
docker 配置 cgroup driver,
vim /etc/docker/daemon.json
{
"registry-mirrors":["https://registry.docker-cn.com","https://kxv08zer.mirror.aliyuncs.com"],
"exec-opts":["native.cgroupdriver=systemd"],
"log-driver":"json-file",
"log-opts":{
"max-size":"100m"
}
}
这一行, 改完了重启docker
"exec-opts":["native.cgroupdriver=systemd"],
edge.yaml
改完了重启 edgecore
当然了, edge node 的状态为 NotReady 还有其他原因 比如 ws url 的填写不正确 等等,good luck
参考链接
Edge node get not ready #1168