I was trying to setup a Kubernetes cluster based on the documentation. https://kubernetes.io/docs/tasks/tools/install-kubeadm/
I install kubeadm by running:
yum install -y kubeadmI was about to update the 10-kubeadm.conf file as mentioned in the doc. But the file looks completely different, it was like this https://github.com/kubernetes/kubernetes/blob/master/build/rpms/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.envThis 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_ARGSIt does not have Cgroup driver variable . So in this case how should we proceed the installation .
First of all ensure that besides kubeadm you also installed kubelet and kubectl. If not, install them.
yum install -y kubelet kubectlCheck if Docker has been started with cgroup driver systemd.
docker info | grep -i cgroupModify your 10-kubeadm.conf file and add a new string.
Environment="KUBELET_CGROUP_ARGS=--cgroup-driver=systemd"Additionally, you have to add $KUBELET_CGROUP_ARGS variable to the ExecStart section.
And as a final step, reload systemd manager configuration and restart kubelet service as described here.
systemctl daemon-reload && service kubelet restartUPDATE
Since version 1.11 Kubernetes automatically detects the right cgroup driver and you can just skip step about settings of cgroup driver. That is from the changelog:
kubeadmnow detects the Dockercgroupdriver and starts thekubeletwith the matching driver. This eliminates a common error experienced by new users in when the Dockercgroupdriver is not the same as the one set for thekubeletdue to different Linux distributions setting differentcgroupdrivers for Docker, making it hard to start thekubeletproperly. (#64347, @neolit123)