Is there a way in Kubernetes to list all API endpoints currently available? So that I can get an updated list of all possible API endpoints as long as I have at least one valid API endpoint.

  • 1
    Do you mean something like that $ kubectl get ep --all-namespaces? – Dawid Kruk Feb 27 '20 at 10:38

Is there a way in Kubernetes to list all API endpoints currently available?

Yes, there is. You can get all the endpoints with kubectl command:

$ kubectl get endpoints --all-namespaces

You could type a shorter version of above command:

$ kubectl get ep -A ( -Afrom version 1.14 and newer)

Output of above command should look like that:

NAMESPACE     NAME                             ENDPOINTS                                            AGE
default       hello-service          ,,    14s
default       kubernetes                       AAA.BBB.CCC.DDD:443                                  18h
kube-system   default-http-backend                                          18h
kube-system   gcp-controller-manager           <none>                                               18h
kube-system   heapster                                                      18h
kube-system   kube-controller-manager          <none>                                               18h
kube-system   kube-dns               ,, + 1 more...   18h
kube-system   kube-scheduler                   <none>                                               18h
kube-system   managed-certificate-controller   <none>                                               18h
kube-system   metrics-server                                                 18h

Take a specific look on:

default       kubernetes                       AAA.BBB.CCC.DDD:443                                  18h

It's a point of contact to your Kubernetes cluster.

You can also use $ kubectl describe endpoint EP_NAME to get more information:

Name:         hello-service
Namespace:    default
Labels:       <none>
Annotations:  endpoints.kubernetes.io/last-change-trigger-time: 2020-02-28T06:30:22Z
  NotReadyAddresses:  <none>
    Name     Port   Protocol
    ----     ----   --------
    <unset>  50001  TCP

Events:  <none>

Please refer to additional resources:

Let me know if you have any questions to that.

  • So an endpoint in the default namespace named kubernetes is always and API endpoint? – Fionn Feb 28 '20 at 14:25
  • Endpoint that I showed above is one of the many ways to access Kubernetes API. Please refer to 1.Kubernetes.io: Access cluster API 2. Oreilly: Managing Kubernetes. Please write your question once more if it's possible because it's hard for me to understand what you meant by it. – Dawid Kruk Mar 2 '20 at 9:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.