I am running k8s cluster for evaluation purposes inside some vagrant box. I have external kubectl access. I was able to get PostgreSQL helm template running on the cluster. But now let say I want to access it outside of the k8s(or VM actually).
There is a problem that I am not very educated in the niceties of Host to Quest communication in VM not to speak about the k8s stack. By empirical research I have found that turning service to NodePort makes it available outside the k8s. But as I said the installed PostgreSQL service is ClusterIP so I want to access it outside aswell without finding a way to turn it to NodePort. So there is couple of noob questions here
- what is difference between
kubectl proxy
andkubectl port-forward
? - what is different when executing
kubectl proxy
from inside VM running k8s cluster and running the same kubectl command on the host? - what is the usual way to make services available outside of the cluster, when using the cluster just for development?
- is this quote true?
port forwarding is not needed when using private network and accessing guest from host with guest private ip, port forwarding is used to access guest with localhost/127.0.0.1 the ports are then forwarded