• May 30, 2023
  • 1 views
  • 0 Comments
# go edit the kuelet configu file 
vi /etc/default/kubelet

# add following line
KUBELET_EXTRA_ARGS="--cgroup-driver=cgroupfs"


# edit the kubeadm conf file 
sudo vi /etc/systemd/system/kubelet.service.d/10-kubeadm.conf

# add following line below under service 
Environment="KUBELET_EXTRA_ARGS=--fail-swap-on=false"

# restart both the kubelet and the daemon 
systemctl daemon-reload

systemctl restart kubelet

# next run the initialize with the CIDR of 10.244.0.0/16
kubeadm init --pod-network-cidr=10.244.0.0/16

# After you run the kubeadm init 
# it will output the following command to join your worker node to the cluster 
# store the token into a safe place 
# example below
kubeadm join 172.30.9.30:6443 --token kce5ji.5r6wis7xaqzkbw2v 
        --discovery-token-ca-cert-hash sha256:06699b8fb404dbddb98614549c499c8002bb1f65bae41e6e61f5dded761ff60e


# now create your kube config file using commands below 
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config