Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List all controllers running in Kubernetes

I just installed the controller via Helm, I can list the helm packages via helm list, but is it possible to list all the controllers running in the cluster via kubectl or api-query?

like image 435
Sumit Murari Avatar asked Sep 13 '18 05:09

Sumit Murari


People also ask

How many controllers are there in Kubernetes?

Types of Controllers We'll then dig into the four most used controllers. ReplicaSet - A ReplicaSet creates a stable set of pods, all running the same workload. You will almost never create this directly. Deployment - A Deployment is the most common way to get your app on Kubernetes.

How do I check my kube-controller-manager?

You can check the metrics available for your version in the Kubernetes repo (link for the 1.15. 3 version). Number of kube-controller-manager instances: This value will give an idea of the general health of the kubelet in the nodes. The expected value is the number of nodes in the cluster.

How do I see what services are running in Kubernetes?

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.

Which of the following controllers are available in Kubernetes?

Examples of controllers that ship with Kubernetes today are the replication controller, endpoints controller, namespace controller, and serviceaccounts controller.


2 Answers

Not sure if there is a way to list controllers in k8s. every resource/object in k8s is controlled by a controller (control loop) with spec fields as values for desired state. if you have deployed a controller outside control plane (built-in controllers) then what i will do to find the controller:

  1. find the resource/object by running kubectl api-resources
  2. verify the list and find the resource name
  3. search all pods and grep the resource name kubectl get pods --all-namespaces |grep <resource-name>
  4. the pod in the above search will be running you controller
  5. NOTE: the pod name might not contain the resource name but it will contain some similar name. i just share this info to understand what a controller is and how external controller works other than (build in controllers).

more info - https://kubernetes.io/docs/concepts/architecture/controller/

like image 113
Sandeep kumar singh Avatar answered Sep 28 '22 05:09

Sandeep kumar singh


If you mean replication controller then you can list them by kubectl:

kubectl get replicationcontroller -n my-namespace

Or list them all from all the namespaces:

kubectl get rc --all-namespaces

And you can also use API:

curl http://localhost:8080/api/v1/replicationcontrollers

Update: You can list other controller types like replicaset (rs), deployment (deploy), statefulset, daemonset (ds) and job in the same way.

like image 31
cgrim Avatar answered Sep 28 '22 03:09

cgrim