<p>Is there a way to query from an API the resources under <code>Kubernetes Engine &gt; Services &amp; Ingress</code> in the GCloud console ?</p>

cyberhippo
<p>It's a good question. The answer is slightly complicated.</p>
<p>Essentially, IIUC, you want to list the Kubernetes services and ingresses for your cluster(s). This functionality is provided by Kubernetes' API server rather than Kubernetes Engine itself.</p>
<p>So, you can do this various ways but, commonly (using the <a href="https://kubernetes.io/docs/reference/kubectl/overview/" rel="nofollow noreferrer"><code>kubectl</code></a> command-line):</p>
<pre class="lang-sh prettyprint-override"><code>kubectl get services [--namespace=${NAMESPACE}]
kubectl get ingresses [--namespace=${NAMESPACE}]
</code></pre>
<p>If you've deployed e.g. Kubernetes <a href="https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/" rel="nofollow noreferrer">Web UI</a> formerly Dashboard, you should be able to enumerate the services|ingresses through it too.</p>
<p>You may also interact directly with your clusters' API servers to make the underlying REST API call that's made by <code>kubectl</code> using the above commands.</p>
<p>For Kubernetes Engine, Cloud Console is accessing 2, distinct APIs:</p>
<ol>
<li>The Kubernetes Engine API that provisions|manages clusters and is documented <a href="https://cloud.google.com/kubernetes-engine/docs/reference/rest/" rel="nofollow noreferrer">here</a>, accessible through Console and <code>gcloud</code>.</li>
<li>The Kubernetes API that provisions|manages resources (e.g. Pods, Deployments, Services, Ingress etc.) that are owned by the cluster and are documented <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/" rel="nofollow noreferrer">here</a>, some (!) are accessible through Console. All are accessible directly or commonly using Kubernetes' command-line <code>kubectl</code>.</li>
</ol>
