title: KOPS: Kubernetes Cluster with private networking on AWS VPC: Error Listing Nodes
body: <p>I followed this tutorial: <a href="https://kubecloud.io/setting-up-a-highly-available-kubernetes-cluster-with-private-networking-on-aws-using-kops-65f7a94782ef" rel="nofollow noreferrer">Kubernetes Cluster with private networking on AWS using Kops</a></p>
  
  <p>However, after creating the kubernetes cluster, I am getting the following error:</p>
  
  <pre><code>$ kops validate cluster
  Using cluster from kubectl context: k8s-cluster.mydomain.com
  Validating cluster k8s-cluster.mydomain.com
  </code></pre>
  
  <h2>Error Message:</h2>
  
  <pre><code>unexpected error during validation: error listing nodes: Get https://subdomain.eu-central-1.elb.amazonaws.com/api/v1/nodes: EOF
  </code></pre>
  
  <p>Any ideas on how to debug or resolve this issue?</p>
  
  <hr>
  
  <p>Steps I used to create are below:</p>
  
  <p><strong>Setup VPC and Subnets</strong></p>
  
  <p>Create the VPC</p>
  
  <pre><code>$ aws ec2 create-vpc --cidr-block 10.0.0.0/16 --region eu-central-1
  </code></pre>
  
  <p>Allow DNS hostnames</p>
  
  <pre><code>$ aws ec2 modify-vpc-attribute --vpc-id ${VPC_ID} --enable-dns-hostnames "{\"Value\":true}" --region ${REGION}
  </code></pre>
  
  <p>Create internet gateway</p>
  
  <pre><code>$ aws ec2 create-internet-gateway --region ${REGION}
  </code></pre>
  
  <p>Attach internet gateway to VPC</p>
  
  <pre><code>$ aws ec2 attach-internet-gateway --internet-gateway-id ${INTERNET_GATEWAY_ID} --vpc-id ${VPC_ID} --region ${REGION}
  </code></pre>
  
  <p>[PUBLIC SUBNETS] Create three public zones / subnets (3x)</p>
  
  <pre><code>$ aws ec2 create-subnet --vpc-id ${VPC_ID} --cidr-block 10.0.0.0/20 --availability-zone ${AVAILABILITY_ZONE_1} --region ${REGION}
  </code></pre>
  
  <p>Set public subnets to auto-assign public ip to instances (3x)</p>
  
  <pre><code>$ aws ec2 modify-subnet-attribute --subnet-id ${PUBLIC_SUBNET_1} --map-public-ip-on-launch --region ${REGION}
  </code></pre>
  
  <p>[PRIVATE SUBNETS] Create three private zones / subnets (3x)</p>
  
  <pre><code>$ aws ec2 create-subnet --vpc-id ${VPC_ID} --cidr-block 10.0.48.0/20 --availability-zone ${AVAILABILITY_ZONE_1} --region ${REGION}
  </code></pre>
  
  <p>[Setup NAT Gateways] Allocate address (3x)</p>
  
  <pre><code>$ aws ec2 allocate-address --domain vpc --region ${REGION}
  </code></pre>
  
  <p>Create NAT gateway for public zones (3x)</p>
  
  <pre><code>$ aws ec2 create-nat-gateway --subnet-id ${PUBLIC_SUBNET_1} --allocation-id ${EIP_ALLOCATION_ID_1} --region ${REGION}
  </code></pre>
  
  <p>[CONFIGURE ROUTE TABLES] Create route table</p>
  
  <pre><code>$ aws ec2 create-route-table --vpc-id ${VPC_ID} --region ${REGION}
  </code></pre>
  
  <p>Create route for internet gateway</p>
  
  <pre><code>$ aws ec2 create-route --route-table-id ${RTB_PUBLIC_1} --destination-cidr-block 0.0.0.0/0 --gateway-id ${INTERNET_GATEWAY_ID} --region ${REGION}
  </code></pre>
  
  <p>Associate public subnets with route table (3x)</p>
  
  <pre><code>$ aws ec2 associate-route-table --route-table-id ${RTB_PUBLIC_1} --subnet-id ${PUBLIC_SUBNET_1} --region ${REGION}
  </code></pre>
  
  <p>[ROUTE TABLE FOR PRIVATE ZONES] Create route table for each private zone (3x)</p>
  
  <pre><code>$ aws ec2 create-route-table --vpc-id ${VPC_ID} --region ${REGION}
  </code></pre>
  
  <p>Create route to NAT Gateway (3x)</p>
  
  <pre><code>$ aws ec2 create-route --route-table-id ${RTB_PRIVATE_1} --destination-cidr-block 0.0.0.0/0 --nat-gateway-id ${NAT_GW_1} --region ${REGION}
  </code></pre>
  
  <p>Associate subnets (3x)</p>
  
  <pre><code>$ aws ec2 associate-route-table --route-table-id ${RTB_PRIVATE_1} --subnet-id ${PRIVATE_SUBNET_1} --region ${REGION}
  </code></pre>
  
  <hr>
  
  <p><strong>Other Configuration</strong></p>
  
  <p>Set up S3 Bucket as Kops state store</p>
  
  <pre><code>$ aws s3api create-bucket --bucket my-state-store --region ${REGION} --create-bucket-configuration LocationConstraint=eu-central-1
  </code></pre>
  
  <p>Create cluster</p>
  
  <pre><code>$ kops create cluster --node-count 3 --zones ${AVAILABILITY_ZONE_1},${AVAILABILITY_ZONE_2},${AVAILABILITY_ZONE_3} --master-zones ${AVAILABILITY_ZONE_1},${AVAILABILITY_ZONE_2},${AVAILABILITY_ZONE_3} --state ${KOPS_STATE_STORE} --dns-zone=${DNS_ZONE_PRIVATE_ID} --dns private --node-size m5.large --master-size m5.large --topology private --networking weave --vpc=${VPC_ID} --bastion ${NAME}
  </code></pre>
  
  <p>Edit cluster to config subnets</p>
  
  <pre><code>$ kops edit cluster ${NAME}
  </code></pre>
  
  <p>Note: update subnets to correspond with created public/private subnets above</p>
  
  <pre><code>$ kops update cluster ${NAME} --yes
  </code></pre>