A V
A V

Reputation: 261

Access Kubernetes Configmap outside of cluster

We are experimenting with Kubernetes. Already have developed bunch of Spring boot Microservices which are ready to be integrated with kubernetes.

We would like to keep dev environment (local) simple and not complicate developers with running local kubernetes clusters/ building images etc.

  1. Is there any solution to access Kubernetes config-map/secrets outside of its cluster?
  2. Is there any way to discover services running in a Kubernetes cluster in a standalone spring boot Microservice app??

Thanks in advance! A

Upvotes: 3

Views: 1086

Answers (1)

vascop
vascop

Reputation: 5212

Kubernetes relies on its API servers for all operations. You can use this API to query/do anything within Kubernetes.

  1. Get a configmap with the API: GET /api/v1/namespaces/{namespace}/configmaps/{name}

  2. List all the services: GET /api/v1/namespaces/{namespace}/services/

How you access the API will depend on your particular setup but you can test it quickly by running kubectl proxy and just using curl in localhost.

Upvotes: 1

Related Questions