About : CreateContainerError

7/22/2019

i installed K8S cluster in my laptop, it was running fine in the beginning but when i restarted my laptop then some services were not running.

kube-system   coredns-5c98db65d4-9nm6m             0/1     Error                  594        12d
kube-system   coredns-5c98db65d4-qwkk9             0/1     CreateContainerError


kube-system   kube-scheduler-kubemaster            0/1     CreateContainerError  

I searched online for solution but could not get appropriate answer , please help me resolve this issue

-- Harsha K
google-kubernetes-engine
kubernetes
kubernetes-pod

2 Answers

7/22/2019

Did you check the status of docker and kubelet services.? if not, please run below commands and verify that services are up and running.

  systemctl status docker kubelet
-- Subramanian Manickam
Source: StackOverflow

7/23/2019

I encourage you to look for official kubernetes documentation. Remember that your kubemaster should have at least fallowing resources: 2CPUs or more, 2GB or more of RAM.

  1. Firstly install docker and kubeadm (as a root user) on each machine.

  2. Initialize kubeadm (on master):

kubeadm init <args>

For example for Calico to work correctly, you need to pass --pod-network-cidr=192.168.0.0/16 to kubeadm init:

kubeadm init --pod-network-cidr=192.168.0.0/16
  1. Install a pod network add-on (depends on what you would like to use). You can install a pod network add-on with the following command:
kubectl apply -f <add-on.yaml>

e.g. for Calico:

kubectl apply -f https://docs.projectcalico.org/v3.8/manifests/calico.yaml
  1. To start using your cluster, you need to run on master the following as a regular user:
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
  1. You can now join any number of machines by running the following on each node as root:
kubeadm join <master-ip>:<master-port> --token <token> --discovery-token-ca-cert-hash sha256:<hash>

By default, tokens expire after 24 hours. If you are joining a node to the cluster after the current token has expired, you can create a new token by running the following command on the control-plane node:

kubeadm token create

Please, let me know if it works for you.

-- muscat
Source: StackOverflow