-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[aws-eks] attach cluster security group to self managed nodes to allow free communication between all node groups #10884
Comments
+1 |
@akerbergen thanks for reporting this. You can add the shared security group of the cluster to the self managed group like so: const cluster = new eks.Cluster(...)
const selfManagedGroup = cluster.addAutoScalingGroupCapacity(...)
selfManagedGroup.addSecurityGroup(ec2.SecurityGroup.fromSecurityGroupId(this, 'SharedSecurityGroup', cluster.clusterSecurityGroupId)) This seems like a good default to apply, so i'm marking this as a feature request. Would appreciate a response if this resolved your issue or is something else needed. Thanks |
I already tried this approach. The node communication worked, including DNS. But somehow when I create a Kubernetes |
@dirknilius Not sure...Do you maybe have a minimal reproduction test case in code that I can run? |
@iliapolo I could extract the essentials from my stack and create a demo that you can deploy. I will post the link when I'm done. |
Hmm, the minimal setup worked. I definitely can trigger this issue in my stack by adding and removing the security group reference. I also tried to delete and recreate the stack. Same result. But maybe something else is interfering here. I will come back later if I found something out. |
@dirknilius Awesome, thanks |
When using the aws load balancer controller i can see in logs that it refuses to create the LB because my ENI as 2 SG attached to it. By manually remove the first SG (only keeping the cluster SG) the load balancer is correctly created. Maybe you have the same problem ? Also I think that if by default we create the nodegroups with only tue cluster SG that would solve both problems |
Attaching the EKS managed cluster security group to self managed nodes to allow free traffic flow between managed and self-managed nodes. Closes #10884 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Hi @iliapolo @dirknilius , Sorry for bumping this issue up. But I am experiencing a similar issue so really appreciate your input here I came up a similar idea of
Thank you! |
Self managed node groups created with the cluster.addAutoScalingGroupCapacity function does not get a shared security group allowing all traffic between different node groups. Also traffic from managed node groups to self managed node groups are only allowed for tcp port 1025-65535. This causes DNS traffic on port 53 to be blocked between node groups which becomes an issue if you have core-dns pods running on a subset of your self managed node groups as groups without core-dns pods can't do DNS lookups.
The above issue does not exist with eksctl as it creates a shared security group that is used for all self managed and managed node groups, which allow all traffic between them.
Reproduction Steps
Create an EKS cluster with the aws-eks module's cluster construct. Add two self managed node groups with the addAutoScalingGroupCapacity function. Add a managed node group with the addNodegroupCapacity function.
Configure core-dns to run on only one of the self managed node groups.
Start a pod on the other self managed node group that tries to do a nslookup on any domain e.g. kubernetes, or github.com. It fails as it can't connect to the cluster IP for the kube-dns service.
Repeat the above step for a managed node group.
Note: DNS lookup works across managed node groups, if there is a core-dns pod running in any of them, as they all use the same security group, which allows all traffic internally.
What did you expect to happen?
DNS lookups should be possible anywhere in the cluster, regardless of where the core-dns pods are running.
What actually happened?
DNS lookups was not possible due to blocked traffic by the node security groups.
Environment
Other
Working scenarios for DNS lookups (pod doing the lookup on the left, core-dns pod on the right):
Self managed node group 1 -> Self managed node group 1
Managed node group 1 -> Managed node group 1
Managed node group 1 -> Managed node group 2
Failing scenarios for DNS lookups:
Self managed node group 1 -> Self managed node group 2
Managed node group 1 -> Self managed node group 1
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: