<p>How to resolve the domain/hostname of a K8s Service, that a specific K8s Ingress is serving?</p>
<p>In the namespace <code>foobar</code>, I want to know where to connect for the service provided by the ingress.</p>
<pre><code>kubectl --namespace foobar get ingress
</code></pre>
<p>returns the available ones, and</p>
<pre><code>kubectl --namespace foobar describe ingress/bazbar
</code></pre>
<p>returns the details; I can match by name (e.g. <code>barbaz</code>) the one I'm targeting.<br />
But how can I extrapolate the <em>host</em> (and, possibly, also the <em>path</em>) to then launch it in the browser with <code>xdg-open</code>?</p>

Rodrigo
<p>The below should solve your query on getting domain per namespace.</p>
<p>The query below &quot;get ingress&quot; retrieves the domain details from all namespaces and using awk, it prints the 1st column which is the namespace and the 4th column which is the domain in the ingress, you can grep it further to filter down on particular namespace.</p>
<pre><code>#To get all namespace and domain
kubectl get ingress --all-namespaces|awk '{print $1 &quot; | &quot; $4 }'
foobar | foobar.example.com
barfoo | barfoo.example.com


#To filter on namespace from all namespace
kubectl get ingress --all-namespaces|awk '{print $1 &quot; | &quot; $4 }'|grep -i foobar
foobar | foobar.example.com

#To get one namespace
kubectl get ingress -n &lt;namespace-name&gt;|awk '{print $1 &quot; | &quot; $4 }'
foobar | foobar.example.com



</code></pre>
