Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

kubectl get nodes shows NotReady

I have installed two nodes kubernetes 1.12.1 in cloud VMs, both behind internet proxy. Each VMs have floating IPs associated to connect over SSH, kube-01 is a master and kube-02 is a node. Executed export:

no_proxy=127.0.0.1,localhost,10.157.255.185,192.168.0.153,kube-02,192.168.0.25,kube-01

before running kubeadm init, but I am getting the following status for kubectl get nodes:

NAME      STATUS     ROLES    AGE   VERSION
kube-01   NotReady   master   89m   v1.12.1
kube-02   NotReady   <none>   29s   v1.12.2

Am I missing any configuration? Do I need to add 192.168.0.153 and 192.168.0.25 in respective VM's /etc/hosts?

like image 582
Sandeep Nag Avatar asked Oct 29 '18 07:10

Sandeep Nag


People also ask

Why is my node Notready?

Common reasons for a Kubernetes node not ready error include lack of resources on the node, a problem with the kubelet (the agent enabling the Kubernetes control plane to access and control the node), or an error related to kube-proxy (the networking agent on the node).

How can I check my Kubernetes node status?

The kubectl command is used to show the detailed status of the Kubernetes pods deployed to run the PowerAI Vision application. When the application is running correctly, each of the pods should have: A value of 1/1 in the READY column. A value of Running in the STATUS column.

How do you check worker nodes in Kubernetes?

The most common operations can be done with the following kubectl commands: kubectl get - list resources. kubectl describe - show detailed information about a resource. kubectl logs - print the logs from a container in a pod.


2 Answers

Looks like pod network is not installed yet on your cluster . You can install weave for example with below command

kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"

After a few seconds, a Weave Net pod should be running on each Node and any further pods you create will be automatically attached to the Weave network.

You can install pod networks of your choice . Here is a list

after this check

$ kubectl describe nodes

check all is fine like below

Conditions:
  Type              Status
  ----              ------
  OutOfDisk         False
  MemoryPressure    False
  DiskPressure      False
  Ready             True
Capacity:
 cpu:       2
 memory:    2052588Ki
 pods:      110
Allocatable:
 cpu:       2
 memory:    1950188Ki
 pods:      110

next ssh to the pod which is not ready and observe kubelet logs. Most likely errors can be of certificates and authentication.

You can also use journalctl on systemd to check kubelet errors.

$ journalctl -u kubelet
like image 125
Shane Warne Avatar answered Oct 21 '22 16:10

Shane Warne


Try with this

Your coredns is in pending state check with the networking plugin you have used and check the proper addons are added

check kubernates troubleshooting guide

https://kubernetes.io/docs/setup/independent/troubleshooting-kubeadm/#coredns-or-kube-dns-is-stuck-in-the-pending-state

https://kubernetes.io/docs/concepts/cluster-administration/addons/

And install the following with those

And check

kubectl get pods -n kube-system
like image 30
Javeed Shakeel Avatar answered Oct 21 '22 16:10

Javeed Shakeel