failed to run Kubelet: failed to create kubelet: misconfiguration: kubelet cgroup driver: "cgroupfs" is different from docker cgroup driver: "systemd"
那么第一步:
	1./etc/systemd/system/kubelet.service.d/10-kubeadm.conf
查看这个10-kubeadm.conf存不存在,如果不存在,那么直接创建一个:内容是
			# 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"
			# 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/default/kubelet
			ExecStart=
			ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS
然后剩下的就是:
kubectl join了
如果这个时候报错,那么就在:
			/var/lib/kubelet/下
创建kubeadm-flags.env文件
内容是:
			KUBELET_KUBEADM_ARGS="--cgroup-driver=systemd --network-plugin=cni –pod-infra-container-image=k8s.gcr.io/pause:3.1"
那么这样就解决了
Logo

一站式 AI 云服务平台

更多推荐