Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if Kubernetes cluster is running fine

Tags:

kubernetes

I have a Kubernetes cluster running. I used:

kubeadm init --apiserver-advertise-address=192.168.20.101 --pod-network-cidr=10.244.0.0/16

This is working okay. Now I'm putting this in a script and I only want to execute kubeadm init again if my cluster is not running fine. How can I check if a Kubernetes cluster is running fine? So if not I can recreate the cluster.

like image 288
mealesbia Avatar asked Feb 04 '19 18:02

mealesbia


People also ask

How do you check if Kubernetes cluster is running or not?

Using kubectl describe pods to check kube-system If the output from a specific pod is desired, run the command kubectl describe pod pod_name --namespace kube-system . The Status field should be "Running" - any other status will indicate issues with the environment.

How do I check my Kubernetes performance?

You can examine application performance in a Kubernetes cluster by examining the containers, pods, services, and the characteristics of the overall cluster. Kubernetes provides detailed information about an application's resource usage at each of these levels.

What is the use of Kubernetes cluster?

Kubernetes helps in orchestrating and managing clusters at scale across various cloud environments or even on-premise servers. A cluster is a set of hosts meant for running containerized applications and services. A cluster needs a minimum of two nodes to work – one master node and a worker node.

How do I troubleshoot Kubernetes container issues?

The first step to troubleshooting container issues is to get basic information on the Kubernetes worker nodes and Services running on the cluster. To see a list of worker nodes and their status, run kubectl get nodes --show-labels. The output will be something like this:

How do I find the IP address of a Kubernetes cluster?

If you instead use a sudo-enabled user on your Kubernetes nodes, please add sudo to run the commands when necessary. To find the cluster IP address of a Kubernetes pod, use the kubectl get pod command on your local machine, with the option -o wide.

How to check the version of kubectl in Kubernetes?

upon completing the installation you might want to check the version of kubectl and your Kubernetes cluster. This same command can be used for all types of Managed and self-hosted kubernetes like To check the version of kubectl you can use the kubectl version command the same command would return the version of Kubernetes cluster too.


1 Answers

You can use the following command to do that:

[root@ip-10-0-1-19]# kubectl cluster-info
Kubernetes master is running at https://10.0.1.197:6443
KubeDNS is running at https://10.0.1.197:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

It shows that your master is running fine on particular url.

like image 179
Prafull Ladha Avatar answered Oct 20 '22 18:10

Prafull Ladha