How to expose kubernetes service to public without hardcoding to minion IP?

前端 未结 5 874
傲寒
傲寒 2020-12-24 13:12

I have a kubernetes cluster running with 2 minions. Currently I make my service accessible in 2 steps:

  1. Start replication controller & pod
  2. Get mini
5条回答
  •  温柔的废话
    2020-12-24 13:58

    As Robert said in his reply this is something that is coming up, but unfortunately isn't available yet.

    I am currently running a Kubernetes cluster on our datacenter network. I have 1 master and 3 minions all running on CentOS 7 virtuals (vcenter). The way I handled this was to create a dedicated "kube-proxy" server. I basically am just running the Kube-Proxy service (along with Flannel for networking) and then assigning "public" IP addresses to the network adapter attached to this server. When I say public I mean addresses on our local datacenter network. Then when I create a service that I would like to access outside of the cluster I just set the publicIPs value to one of the available IP addresses on the kube-proxy server. When someone or something attempts to connect to this service from outside the cluster it will hit the kube-proxy and then be redirected to the proper minion.

    While this might seem like a work around, this is actually similar to what I would expect to be happening once they come up with a built in solution to this issue.

提交回复
热议问题