How to access kubernete pods on my development environment?

2/6/2017

right now i'm accessing my pods (postgres port 5432) trough a service that is exposed, but since gcloud charge for every forwarding rule created, the amount of pods i need to monitor or to execute stuff in it, is costing me more and more, is there a way to create a single expose service for all of my pods? or can i create some sort of vpn? putty tunnel or something? any help would be appreciated! I'm also using kubectl exec

-- PaulMB
gcloud
google-kubernetes-engine
kubernetes

1 Answer

2/7/2017

If you are looking for a managed solution then Google is offering VPN for that: https://console.cloud.google.com/networking/vpn/

If you are happy to roll your own then you can create a new Compute instance on the same network where your nodes are and set up openvpn there. This will give you a fix ip as a freebie.

A more advanced solution is if you run openvpn as a pod (or pods) and use a Service with NodePort to expose it. (Optionally manually create a single loadbalacer on google cloud to get a static ip for that.)

At the end of the day the ideal solution depends much on your environment and goal.

-- Janos Lenart
Source: StackOverflow