When deploy an eks cluster using the existing public vpc everything works fine. But when I try to use the private vpc everything gets deployed but when I try to get nodes of eks cluster is get no resources found error, when i get pods of the cluster i found that the kube-dns pods are in the pending state.
Is there some kind of permission issue or configuration issue?
Deploy the eks cluster on the private vpc.
I should be able to get the nodes deployed on private subnet
No idea.
@max-rocket-internet kindly have a look at this issue
this is the log from one of the node in private subnet:
Sep 23 10:30:06 ip-172-31-124-177 kubelet: F0923 10:30:06.736075 14523 server.go:261] failed to run Kubelet: could not init cloud provider "aws": error finding instance : "error listing AWS instances: \"RequestError: send request failed\\ncaused by: Post https://ec2.us-X-X.amazonaws.com/: dial tcp XX.XX.XX.XX:443: i/o timeout\""
Without knowing how you're configuring your VPC or calling this module, I'm going to go with the usual suspects:
Fix: either add a NAT gateway/instance and allow the nodes to access the internet or enable the private endpoint via the cluster_endpoint_private_access module input variable.
@dpiddockcmp bringing the knowledge as always.
This issue comes up A LOT:
https://github.com/terraform-aws-modules/terraform-aws-eks/issues/488
https://github.com/terraform-aws-modules/terraform-aws-eks/issues/413
https://github.com/terraform-aws-modules/terraform-aws-eks/issues/358
https://github.com/terraform-aws-modules/terraform-aws-eks/issues/310
https://github.com/terraform-aws-modules/terraform-aws-eks/issues/304
https://github.com/terraform-aws-modules/terraform-aws-eks/issues/522
Might be worth writing a sort of FAQ to point users at?
dial tcp XX.XX.XX.XX:443: i/o timeout
The node cannot connect to the AWS API. Check internet or VPC settings.
thank you @max-rocket-internet and @dpiddockcmp for quick response, vpc is configured properly. When nodes are deployed on the public subnet they are accessible but on the private subnet, nodes are not accessible.
@max-rocket-internet yes it would be good that a FAQ is written for this issue
We're just guessing in the dark here. Please include your VPC and EKS module configs.
Another guess: do you have VPC DNS enabled? This is required for the private endpoint to work. Set enable_dns_hostnames = true on your aws_vpc resource. The terraform-aws-module/vpc/aws community module has a variable of the same name.
@dpiddockcmp the VPC is managed by someone else so I can't provide information about the VPC and thank you for the FAQ.
Closing this issue.
Most helpful comment
Without knowing how you're configuring your VPC or calling this module, I'm going to go with the usual suspects:
Fix: either add a NAT gateway/instance and allow the nodes to access the internet or enable the private endpoint via the
cluster_endpoint_private_accessmodule input variable.