How can I determine which ingress controllers are configured on Kubernetes

4/24/2020

Is there a command I can run or is there some way to identify whether a cluster has one or more ingress controllers configured?

I'm not asking about the actual ingresses themselves (which I know can be found with kubectl get ingress --all-namespaces).

-- Chris Stryczynski
kubernetes
kubernetes-ingress

4 Answers

4/26/2020

As each IngressController needs the privilege to access Ingresses, we can find out all Roles and ClusterRoles which could access Ingress, and then RoleBindings/ClusterRoleBindings, associated ServiceAccounts, finally get all Pods using those ServiceAccounts.

-- kitt
Source: StackOverflow

4/24/2020

There is no specific way since an ingress controller is really just a daemon that talks to the kubernetes API. There is no centralized registration for them. You can start from kubectl get pods --all-namespaces and compare against the names of known controllers.

-- coderanger
Source: StackOverflow

4/27/2020

There is no fancy way to achieve what you need. These two commands can help you and it really depends on what you need to choose between them.

$ kubectl get pods --all-namespaces -o=jsonpath='{range .items[*]}{"\n"}{.metadata.name}{":\t"}{range .metadata}{.labels}{", "}{end}{end}' | grep ingress | grep controller
$ kubectl get pods --show-labels --all-namespaces  | grep ingress | grep controller

Both commands are similar but with different outputs.

These commands are based on this documation page.

-- mWatney
Source: StackOverflow

4/24/2020

You can list all ingress controller pod by using selector. For example

kubectl get pods --all-namespaces --selector app=nginx-ingress,component=controller
-- hoque
Source: StackOverflow