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:
So, is it possible to create this network using kops?
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