<p>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. </p>

<p>I need the network something like below:
<a href="https://i.stack.imgur.com/9uNdM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9uNdM.png" alt="enter image description here"></a></p>

<p>So, is it possible to create this network using kops? </p>

<p>Kubernetes nodes should never be directly connected to the internet. </p>

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

<p>You should place all nodes and masters in private Subnets and manage the external Access via elastic load balancers and <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="noreferrer">ingress</a>. This way you can explicitly expose frontend services to the internet.</p>

<p>The relevant <code>kops-spec.yaml</code> snippet would be:</p>

<pre><code>topology:
  dns:
    type: Public
  masters: private
  nodes: private
</code></pre>
