Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

  1. When initializing kubeadm directly then kubeadm might raise the error:

    Code Block
    Some fatal errors occurred: [ERROR CRI]: container runtime is not running Status from runtime service failed” err=”rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService”



  2. To resolve the above problem users should delete the config.tomal file and restart containerd using the following commands:

    Code Block
    sudo rm /etc/containerd/config.toml
    systemctl restart containerd



  3. Initialize kubeadm, create required directories and manage Kubernetes Cluster configuration:

    Code Block
    sudo kubeadm init
    mkdir $HOME/.kube
    sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
    sudo chown $(id -u):$(id -g) $HOME/.kube/config
    export KUBECONFIG=/etc/kubernetes/admin.conf



  4. Enable and restart Docker and Kubernetes services from systemd.

    Code Block
    sudo systemctl enable docker.service
    sudo service kubelet restart
    sudo chown -R centos:centos kubernetes/
    



  5. To initialize the CNI plugin update your CNI plugins and edit the CNI config files. Use the following command to create the file and open it for editing:

    Code Block
    sudo vi /etc/cni/net.d/10-containerd-net.conflist



  6. Once the file is open, press the I key to enter insert mode and paste the following contents:

    Code Block
    {
     "cniVersion": "1.0.0",
     "name": "containerd-net",
     "plugins": [
       {
         "type": "bridge",
         "bridge": "cni0",
         "isGateway": true,
         "ipMasq": true,
         "promiscMode": true,
         "ipam": {
           "type": "host-local",
           "ranges": [
             [{
               "subnet": "10.88.0.0/16"
             }],
             [{
               "subnet": "2001:db8:4860::/64"
             }]
           ],
           "routes": [
             { "dst": "0.0.0.0/0" },
             { "dst": "::/0" }
           ]
         }
       },
       {
         "type": "portmap",
         "capabilities": {"portMappings": true},
         "externalSetMarkChain": "KUBE-MARK-MASQ"
       }
     ]
    }

    Once pasted, press escape to exit insert mode. Then enter :x to save the file and exit.


  7. We have to taint this node. We can do this by using the kubectl taint command

    Code Block
    kubectl taint nodes <name-node-master> node-role.kubernetes.io/control-plane:NoSchedule-



  8. Set up Pod network for the Kubernetes Cluster.

    Code Block
    kubectl get nodes



...