Here is the Kubernetes (k8s) cluster I have:
I deployed 2 pods on this cluster and deployed 2 services for them as follows:
However, my goal is to let Pod1 only be accessed from outside the cluster by over the Private network and Pod2 only be accessed from outside the cluster over the Public network. I checked the k8s official documentation on Services, it said:
If you want to specify particular IP(s) to proxy the port, you can set the
--nodeport-addresses
flag in kube-proxy to particular IP block(s); .... For example, if you start kube-proxy with the--nodeport-addresses=127.0.0.0/8
flag, kube-proxy only selects the loopback interface for NodePort Services.
It seems the --nodeport-addresses
setting is for global, and can't b applied per Pod/Services. Does anyone know how to configure k8s to achieve my goal?