Skip to content

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

Merged
jayanthvn merged 1 commit intoaws:masterfrom
jayanthvn:custom_net
Nov 3, 2020
Merged

Use primary ENI SGs if SG is null for Custom networking#1259
jayanthvn merged 1 commit intoaws:masterfrom
jayanthvn:custom_net

Conversation

@jayanthvn
Copy link
Copy Markdown
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.

Copy link
Copy Markdown
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:

@jayanthvn jayanthvn requested a review from fawadkhaliq October 14, 2020 21:38
Copy link
Copy Markdown
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.

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