Reputation: 61
Is there a way to query from an API the resources under Kubernetes Engine > Services & Ingress
in the GCloud console ?
Upvotes: 0
Views: 196
Reputation: 40061
It's a good question. The answer is slightly complicated.
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.
So, you can do this various ways but, commonly (using the kubectl
command-line):
kubectl get services [--namespace=${NAMESPACE}]
kubectl get ingresses [--namespace=${NAMESPACE}]
If you've deployed e.g. Kubernetes Web UI formerly Dashboard, you should be able to enumerate the services|ingresses through it too.
You may also interact directly with your clusters' API servers to make the underlying REST API call that's made by kubectl
using the above commands.
For Kubernetes Engine, Cloud Console is accessing 2, distinct APIs:
gcloud
.kubectl
.Upvotes: 1