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

Use primary ENI SGs if SG is null for Custom networking #1259

Merged
merged 1 commit into from
Nov 3, 2020

Conversation

jayanthvn
Copy link
Contributor

What type of PR is this?
Bug

Which issue does this PR fix:
#1124

What does this PR do / Why do we need it:
If SG is not provided in the ENIConfig then use the primary ENI SGs.

If an issue # is not available please add repro steps and logs from IPAMD/CNI showing the issue:

Testing done on this change:

Created ENI config -

cat <<EOF  | kubectl apply -f -
apiVersion: crd.k8s.amazonaws.com/v1alpha1
kind: ENIConfig
metadata:
 name: $AZ1
spec:
  subnet: $CUST_SNET1
EOF

Before fix SG list is empty-

{"level":"info","ts":"2020-10-12T21:11:32.781Z","caller":"awsutils/awsutils.go:610","msg":"Using a custom network config for the new ENI"}
{"level":"info","ts":"2020-10-12T21:11:32.781Z","caller":"awsutils/awsutils.go:610","msg":"Creating ENI with security groups: [] in subnet: subnet-0ac93d8034479e1cf"}
{"level":"info","ts":"2020-10-12T21:11:33.157Z","caller":"awsutils/awsutils.go:610","msg":"Created a new ENI: eni-014407d03b4c13b5f"}

Terminated the nodes and new nodes after fix -

{"level":"info","ts":"2020-10-12T20:55:44.350Z","caller":"ipamd/ipamd.go:638","msg":"ipamd: using custom network config: [], subnet-0ac93d8034479e1cf"}
{"level":"info","ts":"2020-10-12T20:55:44.350Z","caller":"awsutils/awsutils.go:610","msg":"Using a custom network config for the new ENI"}
{"level":"info","ts":"2020-10-12T20:55:44.350Z","caller":"awsutils/awsutils.go:610","msg":"Creating ENI with security groups: [sg-04b933767a4f1d5a0 sg-0c23b7680a45ebfa0] in subnet: subnet-0ac93d8034479e1cf"}
{"level":"info","ts":"2020-10-12T20:55:44.833Z","caller":"awsutils/awsutils.go:610","msg":"Created a new ENI: eni-04344bd43a8d9af7d"}

Automation added to e2e:

Will this break upgrades or downgrades. Has updating a running cluster been tested?:
Upgrades and downgrades should not be impacted. One thing to call out, eni should be deleted and added back for the change to take into effect like terminating the node. Just upgrade will find the existing ENI and re-use it so SG won't be updated.

Does this change require updates to the CNI daemonset config files to work?:

No

Does this PR introduce any user-facing change?:

No


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

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.

It needs a rebase, but otherwise it looks good. :shipit:

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.

/lgtm. Requesting minor rewording.

pkg/awsutils/awsutils.go Outdated Show resolved Hide resolved
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