Where can I see list of services registered in Kubernetes Discovery?
No. Eureka is a service discovery AND registration system. The spring cloud implementation of service discovery on kubernetes only reads from the kubernetes api. You could probably get the information via kubectl.
Kubernetes has an HTTP-based API that you can interact with in many ways (e.g.: kubectl
), of course you can use curl
too.
Here's how: Access Clusters Using the Kubernetes API
If you are curious about your pods, you can do:
kubectl get pods
orkubectl get pods -o json
curl http://localhost:8080/api/v1/pods
If you mean services
(and their registered targets):
kubectl get services
orkubectl services pods -o json
curl http://localhost:8080/api/v1/services
I managed to solve problem after a while.
- Add endpoint in of your microservices. Example here
- Add roles to your kubernetes cluster:
kind: ClusterRoleapiVersion: rbac.authorization.k8s.io/v1metadata: namespace: yours name: service-readerrules: - apiGroups: [""] # "" indicates the core API group resources: ["services"] verbs: ["get", "watch", "list"]apiVersion: rbac.authorization.k8s.io/v1kind: ClusterRoleBindingmetadata: name: service-reader-podsubjects: - kind: ServiceAccount name: default namespace: yoursroleRef: kind: ClusterRole name: service-reader apiGroup: rbac.authorization.k8s.io