<p>I want to list all ingress-urls on a kubernets cluster for every namespace.</p>
<p>I know it´s possible with:</p>
<ol>
<li>kubectl -&gt; kubectl get ingress</li>
<li>numerous clients, e.g. for python: <a href="https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/ExtensionsV1beta1Api.md#list_ingress_for_all_namespaces" rel="nofollow noreferrer">https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/ExtensionsV1beta1Api.md#list_ingress_for_all_namespaces</a></li>
</ol>
<p>For my current situation, a simple REST-Call would be the best solution, but I can´t find any documentation which points me in the right direction. Is there a REST-Endpoint to access above mentioned information on a kubernets cluster?</p>
<p>Thanks in advance.</p>

<p>Yes, you can call the API server to retrieve all ingress rules:
https://kubernetes/apis/extensions/v1beta1/ingresses</p>
<p>This url would work within your cluster environment. Replace it with some public IP/Domain when calling it from the outside.</p>
<p>You will need to authenticate using Bearer Token. That token is usually mounted within your Pods at <code>/var/run/secrets/kubernetes.io/serviceaccount/token</code> (there are some exceptions, for example terraform kubernetes backend defaults to not mounting this token). To get the token for external use, you can export it using:</p>
<pre class="lang-sh prettyprint-override"><code>TOKEN=$(kubectl describe secret $(kubectl get secrets \
     | grep ^default | cut -f1 -d ' ') | grep -E '^token' | cut -f2 -d':' | tr -d &quot; &quot;)
</code></pre>
<p>Here's some more info (not about ingress, but other REST API calls): <a href="https://stackoverflow.com/a/50797128/9423721">https://stackoverflow.com/a/50797128/9423721</a></p>
