docker 启动报错

刚开始启动docker报错是这样的

Failed to restart docker.service: Unit is not loaded properly: Invalid argument.
See system logs and 'systemctl status docker.service' for details.

问题查不出来,不知道那个参数是无效的。因此直接用命令启动docker

/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock

docker启动后,通过/var/log/messages知晓报错信息

failed to run Kubelet: failed to create kubelet: misconfiguration: kubelet cgroup driver: "systemd" is different from docker cgroup driver: "cgroupfs"

修改kubelet的文件驱动,注意evironment添加了,ExecStart也需要添加上

cd /etc/systemd/system/kubelet.service.d/
vi 10-kubeadm.conf
添加--cgroup-driver=cgroupfs
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=cgroupfs"
# 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_CGROUP_ARGS

重启kubelet

 systemctl daemon-reload

 systemctl restart kubelet

pod都重启成功了,但是systemctl restart docker还是不行,不过不影响暂时使用

猜你喜欢

转载自blog.csdn.net/judyjie/article/details/86997399