<p>I am using the following kubectl command to get the Ingress host IP address after my Seldon Deployment is avaible.</p>
<pre><code>kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}'
</code></pre>
<p>I would like to run the same command from the Kubernetes Python API but cannot find any information in the documentation on how to do so.</p>
<p>Could you please help me out?</p>
<p>Thanks in advance.</p>

<p>There's a separate client function for each REST operation on each Kubernetes object type.  Once you have that object, you can navigate it like any other Python object.</p>
<pre class="lang-py prettyprint-override"><code>service = kubernetes.client.read_namespaced_service('istio-ingressgateway', 'istio-system')
print(service.status.load_balancer.ingress[0].ip)
# Note the capitalization ^^^^ of load_balancer, not loadBalancer
</code></pre>
<p>The <code>service</code> object is a <a href="https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/V1Service.md" rel="nofollow noreferrer">V1Service</a> object.  More generally, the <a href="https://github.com/kubernetes-client/python/blob/master/kubernetes/README.md" rel="nofollow noreferrer">API documentation</a> includes every method call and documentation for all of the request and return types.</p>
<p>A Service is a standard Kubernetes object.  If you were dealing with some of the Istio-specific objects like VirtualServices, there is <a href="https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/CustomObjectsApi.md" rel="nofollow noreferrer">a separate API for custom resources</a>.</p>
