<p>With kubectl I can execute the following command: </p>

<pre><code>kubectl get serviceentries 
</code></pre>

<p>Then I receive some information back. But <strong>serviceentries</strong> is a custom resource. So how do I go about getting the same information back but then with the kubernetes client? </p>

<p>Yaml looks like this for example: </p>

<pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
  name: external-svc-https
spec:
  hosts:
  - api.dropboxapi.com
  - www.googleapis.com
  - api.facebook.com
  location: MESH_EXTERNAL
  ports:
  - number: 443
    name: https
    protocol: TLS
  resolution: DNS
</code></pre>

<p>Anyone know the right method to use? </p>

djamaile
<p>you should be able to pull it using the python client like this:</p>

<pre class="lang-py prettyprint-override"><code>kubernetes.client.CustomObjectsApi().list_cluster_custom_object(group="networking.istio.io", version="v1alpha3", plural="serviceentries")
</code></pre>

<p>That method applies to every custom resource within kubernetes and doesn't require any further definition to the python client. </p>
