Kubernetes cluster in public and private topology

11/21/2018

I am trying to setup a kubernetes cluster in aws using Kops. But i have requirement like deploy the master nodes in public subnet and some workers in public and some workers in private subnet.

I need the network something like below: enter image description here

So, is it possible to create this network using kops?

-- Naveen Kerati
amazon-web-services
kops
kubernetes

1 Answer

11/22/2018

Kubernetes nodes should never be directly connected to the internet.

I assume you want to expose services via NodePort which is in general a bad idea. Because NodePort service are exposed on ALL nodes not just the ones where the pods are running.

You should place all nodes and masters in private Subnets and manage the external Access via elastic load balancers and ingress. This way you can explicitly expose frontend services to the internet.

The relevant kops-spec.yaml snippet would be:

topology:
  dns:
    type: Public
  masters: private
  nodes: private
-- Ohmen
Source: StackOverflow