Skip to content
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

Handle EKS created ENI sg update #1098

Merged
merged 1 commit into from
Aug 19, 2020
Merged

Conversation

jayanthvn
Copy link
Contributor

@jayanthvn jayanthvn commented Jul 22, 2020

Issue #964

Description of changes:
Currently when security group is updated to a worker node only the primary ENI was getting updated but not the EKS created ENIs. With this fix - when the security group is refreshed, check is made if new security groups are added or if some are deleted. Based on that security group update is called for all the attached ENIs.

 [
        [
            "ip-192-168-37-145.us-west-2.compute.internal",
            "cni-cri-nodegroup",
            "us-west-2d",
            "192.168.37.145",
            "44.234.21.183",
            [
                [
                    "eni-0a283fed36c186635",
                    [
                        "eks-remoteAccess-24b9aa7f-4032-a130-dd9c-fbf5d790c788",
                        "eks-cluster-sg-cni-cri-916166891"
                    ]
                ],
                [
                    "eni-0744e81da61b30f02",
                    [
                        "eks-remoteAccess-24b9aa7f-4032-a130-dd9c-fbf5d790c788",
                        "eks-cluster-sg-cni-cri-916166891"
                    ]
                ],
                [
                    "eni-03dc607a4b6e01118",
                    [
                        "eks-remoteAccess-24b9aa7f-4032-a130-dd9c-fbf5d790c788",
                        "eks-cluster-sg-cni-cri-916166891"
                    ]
                ]
            ]
        ]

On adding a new SG, all 3 ENIs are getting updated -

[
            "ip-192-168-37-145.us-west-2.compute.internal",
            "cni-cri-nodegroup",
            "us-west-2d",
            "192.168.37.145",
            "44.234.21.183",
            [
                [
                    "eni-0a283fed36c186635",
                    [
                        "eks-remoteAccess-24b9aa7f-4032-a130-dd9c-fbf5d790c788",
                        "eks-cluster-sg-cni-cri-916166891",
                        "JayTesting"
                    ]
                ],
                [
                    "eni-0744e81da61b30f02",
                    [
                        "eks-remoteAccess-24b9aa7f-4032-a130-dd9c-fbf5d790c788",
                        "eks-cluster-sg-cni-cri-916166891",
                        "JayTesting"
                    ]
                ],
                [
                    "eni-03dc607a4b6e01118",
                    [
                        "eks-remoteAccess-24b9aa7f-4032-a130-dd9c-fbf5d790c788",
                        "eks-cluster-sg-cni-cri-916166891",
                        "JayTesting"
                    ]
                ]
            ]
        ]
{"level":"info","ts":"2020-08-19T02:18:43.750Z","caller":"ipamd/ipamd.go:293","msg":"Custom networking false"}
kubectl set env daemonset aws-node -n kube-system AWS_VPC_K8S_CNI_CUSTOM_NETWORK_CFG=false
{"level":"info","ts":"2020-08-19T02:21:51.418Z","caller":"ipamd/ipamd.go:293","msg":"Custom networking true"}

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@jayanthvn jayanthvn requested a review from mogren July 22, 2020 07:23
@jayanthvn jayanthvn self-assigned this Jul 22, 2020
Copy link
Contributor

@nithu0115 nithu0115 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jayanthvn thanks for making this change. This requires few changes. Please see comments!

pkg/awsutils/awsutils.go Show resolved Hide resolved
pkg/awsutils/awsutils.go Outdated Show resolved Hide resolved
@jayanthvn jayanthvn force-pushed the sg_update_fix branch 5 times, most recently from 54c8d13 to e94d4ba Compare August 5, 2020 15:18
pkg/awsutils/awsutils.go Outdated Show resolved Hide resolved
pkg/ipamd/ipamd.go Show resolved Hide resolved
pkg/awsutils/awsutils.go Outdated Show resolved Hide resolved
pkg/awsutils/awsutils.go Outdated Show resolved Hide resolved
pkg/awsutils/awsutils.go Outdated Show resolved Hide resolved
@jayanthvn jayanthvn force-pushed the sg_update_fix branch 2 times, most recently from 68abd73 to bf7f147 Compare August 18, 2020 18:59
pkg/awsutils/awsutils.go Outdated Show resolved Hide resolved
@jayanthvn jayanthvn force-pushed the sg_update_fix branch 2 times, most recently from 04361ac to b72b7ac Compare August 18, 2020 20:49
pkg/ipamd/ipamd.go Outdated Show resolved Hide resolved
pkg/ipamd/ipamd.go Outdated Show resolved Hide resolved
pkg/ipamd/ipamd.go Outdated Show resolved Hide resolved
pkg/awsutils/awsutils.go Outdated Show resolved Hide resolved
Copy link
Contributor

@mogren mogren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice @jayanthvn! Requires a rebase though.

pkg/awsutils/awsutils.go Outdated Show resolved Hide resolved
@mogren mogren merged commit f2ad9ba into aws:master Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants