Access Kubernetes Configmap outside of cluster

11/3/2017

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

-- A V
kubernetes
spring

1 Answer

11/3/2017

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.

-- vascop
Source: StackOverflow