[aws-eks] Private Cluster not getting created after specifying subnets public SubnetIDs
See original GitHub issueReproduction Steps
- Running the following section in CDK returns
Lambda Functions in a public subnet can NOT access the internet. If you are aware of this limitation and would still like to place the function int a public subnet, set `allowPublicSubnet` to true
- Python script
vpc = ec2.Vpc.from_lookup(self, "VPC",
vpc_id = "vpc-12345678"
)
eks_cluster = eks.Cluster(self, "EKS_Cluster",
endpoint_access=eks.EndpointAccess.PRIVATE,
default_capacity=0,
version=eks.KubernetesVersion.V1_17,
cluster_name="micro-k8s-dev",
vpc=vpc,
vpc_subnets=[ec2.SubnetSelection(subnets=[
ec2.Subnet.from_subnet_id(self, 'nonprod-vm-pub-a', 'subnet-2jh3j2h34jh234jhjh')],
ec2.Subnet.from_subnet_id(self, 'nonprod-vm-pub-b', 'subnet-2jh3j2h34jh234jhjh'),
ec2.Subnet.from_subnet_id(self, 'nonprod-k8s-pri-a', 'subnet-2jh3j2h34jh234jhjh'),
ec2.Subnet.from_subnet_id(self, 'nonprod-k8s-pri-b', 'subnet-2jh3j2h34jh234jhjh')],
]]
)
What did you expect to happen?
Cluster is created successfully
What actually happened?
Following error
Lambda Functions in a public subnet can NOT access the internet. If you are aware of this limitation and would still like to place the function int a public subnet, set `allowPublicSubnet` to true
Environment
- CDK CLI Version : 1.73.0
- OS : MacOS Catalina
- Language (Version): Python (3.8.2)
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (7 by maintainers)
Top Results From Across the Web
Amazon EKS VPC and subnet requirements and considerations
When you create a cluster, the VPC that you specify must meet the following requirements and considerations: The VPC must have a sufficient...
Read more >Creating an Amazon EKS cluster - 亚马逊云科技
Learn how to create an Amazon EKS cluster. ... If you'd rather specify public subnets, you can change --vpc-private-subnets to --vpc-public-subnets .
Read more >Create a simple EKS cluster - DEV Community
The subnets can be a public or private in our case will create public ... Kubernetes clusters managed by Amazon EKS make calls...
Read more >VPC and Subnet Considerations - EKS Best Practices Guides
EKS places a X-ENI in each subnet specified during cluster create (also called ... When both the public and private endpoints are enabled,...
Read more >EKS Fully-Private Cluster - eksctl
eksctl supports creation of fully-private clusters that have no outbound ... be specified and it's an error to specify subnets under vpc.subnets.public ....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey, you were right I was encountering the 2nd issue, the fix mentioned solved it!
@shrivastavshubham34 of course 😃