softshipper
softshipper

Reputation: 34071

Best practice to publish K8s to internet

I have a K8s cluster, that I would like to publish to the internet. What is the best practice to publish K8s to internet?

The K8s is installed on 3 VPS server and it is in the private network.

I have the following idea:

enter image description here

With the proxy. Requests will pass through proxy and will be forwarded to K8s. enter image description here

Or directly to K8s.

Upvotes: 0

Views: 186

Answers (1)

Vasilii Angapov
Vasilii Angapov

Reputation: 9022

One way is "OpenShift router" style - you have one (or more) node which has public IP and join it to K8s cluster with some distinct label on it. Then you launch ingress controller like Nginx on this node using NodeSelector and hostNetwork=true. In this scheme Nginx ingress will be available on Internet and is able to publish your services.

Another way is to have the same proxy node with public IP (without joining to K8s) and make it load balance requests to all K8s nodes. You can then publish your services using NodePort and configure proxy for each service. Or you can launch Nginx ingress as NodePort in K8s and forward requests from proxy node to Nginx ingress NodePort.

I would prefer first option because it is simpler to configure.

Upvotes: 1

Related Questions