<p>Similar to <a href="https://stackoverflow.com/questions/53299238/how-can-i-check-what-ingress-controller-i-have-on-my-kube-and-what-is-the-defaul">this question</a> but for generic kubernetes. How can software I'm writing programmatically detect whether there is any ingress controller already existing in the cluster? </p>

TREE
<p>You most probably can't, since an ingress controller simply is a deployment that reads and interprets Kubernetes ingress resources by fetching them from the Kubernetes API server using REST or some other Kubernetes API client.</p>

<p>If ingress resources are present, that's a strong hint that an ingress controller is present though.</p>

<p>An <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#the-ingress-resource" rel="nofollow noreferrer">ingress resource</a> is a Kubernetes resource to define ingress rules. You can query the Kubernetes API server at <a href="https://kubernetes/apis/extensions/v1beta1/ingresses" rel="nofollow noreferrer">https://kubernetes/apis/extensions/v1beta1/ingresses</a> or use <code>kubectl get ingress</code> as mentioned by others.</p>

<p>It's not mandatory to annotate the <code>ingress.class</code> unless multiple ingress controllers are present (see <a href="https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/#using-multiple-ingress-controllers" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/#using-multiple-ingress-controllers</a>).</p>

<p>So in the end you may find hints, that an ingerss controller is present, and by reading ingress rules and their annotations you may also get hints which ingress controller is present, but you can't depend on it.</p>
