<p><strong>2 VPC's:</strong></p>

<p><strong>Primary VPC:</strong> 10.111.0.0/22</p>

<p>Primary VPC Subnet contains 4 subnets:</p>

<pre><code>10.111.0.0/25
10.111.0.128/25
10.111.1.0/25
10.111.1.128/25
</code></pre>

<p><strong>Secondary VPC:</strong> Kubernetes Minion VPC (172.16.0.0/20)</p>

<p>Additional notes: 
Primary VPC &amp;&amp; Secondary VPC uses VPC peering to enable communication between the 2 VPC's</p>

<p><strong>The issue:</strong> Is it possible to separate minion instances / nodes / pods etc out in their own VPC in order to save network space in the primary VPC.  If possible I'd love to have the master and service endpoints running under the primary vpc so they are directly routable without going over public internet, and having the nodes / pods etc in their own space not cluttering up the already small ip space we have.</p>

<p>PS: The primary VPC address space is only a /22 due to ip overlap restrictions with the main corporate network.</p>

<p>As soon as you define a service endpoint that is reachable from outside your k8s cluster (no matter if you use the <a href="https://kubernetes.io/docs/user-guide/services/#type-nodeport" rel="nofollow noreferrer"><code>NodePort</code></a> or <a href="https://kubernetes.io/docs/user-guide/services/#type-loadbalancer" rel="nofollow noreferrer"><code>LoadBalancer</code></a> option), k8s opens a service port on every node in your cluster (also on the master nodes). 
Every node in your cluster runs a kube-proxy, which takes care that any request on a service port gets routed to a running Pod, even if that Pod is running in an entirely different node in another VPC (given that the node is reachable via peering of course). 
Further, Pods run in virtual networks that have nothing to do with your physical network of your nodes - so the <strong>Pods do not exhaust your network's IP space</strong>, but the number of nodes in your VPC/network does.
So, I think you should just limit the number of nodes in your VPC which has limited IP space (you could just place the master nodes there the way you wanted) and put the worker nodes in the other VPC. </p>

<p><em>About Node affinity of Pods</em>: You could assign Pods to specific worker nodes (see <a href="https://kubernetes.io/docs/user-guide/node-selection/" rel="nofollow noreferrer">here</a>). 
For instance you could assign all your Pods to worker nodes in a single VPC, and route any public traffic to nodes in the other VPC, which will then proxy the traffic to a running Pod, but this does not tackle your IP space problem at all.</p>

<p><strong>Update:</strong></p>

<p>Concerning the service endpoints: When you configure a service which is reachable from outside your k8s cluster the master node first allocates a port, which is from then on reserved for that service. That port is then opened on every node (master and worker nodes) in your cluster. The port is operated by the kube-proxy, which of course also resides on every node. The kube-proxy then takes care of the rest and proxies the incoming traffic from that port to a running pod for the corresponding service, even if that pod is running on a completely different node (internally k8s achieves this with some iptables magic). This means you can send your request to that port (lets call it now <code>&lt;service-port&gt;</code>) on any node in your cluster. Your service endpoint is basically <code>&lt;proto&gt;://&lt;any-worker-or-master-node-ip&gt;:&lt;service-port&gt;</code>. With this you could also easily setup an ELB and add all your nodes as instances, so you have a public internet-facing endpoint. All this is explained in more detail <a href="https://kubernetes.io/docs/user-guide/services/#virtual-ips-and-service-proxies" rel="nofollow noreferrer">here</a>.</p>
