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

feat: add custom environment variables to the 'aws-node' DaemonSet #3374

Merged

Conversation

charlie-haley
Copy link
Contributor

What type of PR is this?
/kind feature

What this PR does / why we need it:
Ability to add custom environment variables to the aws-node DaemonSet. This is mostly so you can increase pod limits on nodes through the ENABLE_PREFIX_DELEGATION environment variable, but this PR supports all environment variables.

Which issue(s) this PR fixes:
Fixes #3244

Checklist:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 1, 2022
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Apr 1, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: charlie-haley / name: Charlie Haley (26b13ab58d7f17587513cd787b10d6cf0468b9f8)

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Apr 1, 2022
@k8s-ci-robot
Copy link
Contributor

@charlie-haley: This issue is currently awaiting triage.

If CAPA/CAPI contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot
Copy link
Contributor

Welcome @charlie-haley!

It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-aws 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api-provider-aws has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 1, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @charlie-haley. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 1, 2022
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Apr 1, 2022
@richardcase
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 1, 2022
@richardcase
Copy link
Member

richardcase commented Apr 1, 2022

@charlie-haley - For the verify issue i think you need to run go mod tidy. The linter error is a weird one. Lets chat Monday morning on slack.

@richardcase
Copy link
Member

And thanks for working on this 👍

@pydctw
Copy link
Contributor

pydctw commented Apr 1, 2022

@charlie-haley - For the verify issue i think you need to run go mod tidy. The linter error is a weird one. Lets chat Monday morning on slack.

The linter error message is cryptic but basically the import order needs to be changed. See comment

@pydctw
Copy link
Contributor

pydctw commented Apr 5, 2022

pull-cluster-api-provider-aws-verify - looks like generated conversion files are out of date. Could you run make generate?

generated files are out of date, run make generate
make: *** [Makefile:319: verify-gen] Error 1

@pydctw
Copy link
Contributor

pydctw commented Apr 6, 2022

Great to see tests passing - 🎉. Now, time to run e2e test

/test pull-cluster-api-provider-aws-e2e-eks

@pydctw
Copy link
Contributor

pydctw commented Apr 7, 2022

e2e test result looks good to me

I0406 16:46:04.492514       1 cni.go:44]  "msg"="Reconciling aws-node DaemonSet in cluster"  "cluster-name"="cluster-yknmkm" "cluster-namespace"="eks-nodes-lrf3qi"
I0406 16:46:04.966908       1 cni.go:68]  "msg"="updating aws-node daemonset environment variables"  "cluster-name"="cluster-yknmkm" "cluster-namespace"="eks-nodes-lrf3qi"

AWSManagedControlPlane

spec:
  addons:
  - conflictResolution: overwrite
    name: vpc-cni
    version: v1.8.0-eksbuild.1
  - conflictResolution: overwrite
    name: coredns
    version: v1.8.3-eksbuild.1
  associateOIDCProvider: false
  awsNodeEnvVars:
  - name: FOO
    value: BAR
  - name: ENABLE_PREFIX_DELEGATION
    value: "true"

@pydctw
Copy link
Contributor

pydctw commented Apr 7, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 7, 2022
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 21, 2022
@charlie-haley charlie-haley force-pushed the feat/aws-node-env-vars branch 2 times, most recently from 63e0b72 to a01325c Compare June 21, 2022 08:22
@charlie-haley
Copy link
Contributor Author

/test pull-cluster-api-provider-aws-e2e-eks

@charlie-haley charlie-haley force-pushed the feat/aws-node-env-vars branch 3 times, most recently from b2d5aca to 3627fda Compare June 22, 2022 09:10
@charlie-haley
Copy link
Contributor Author

Not sure what's happening here, I don't get any changes when running make generate locally, I also rebased onto master (which fixed the apidiff issue) any ideas @richardcase @pydctw?

@richardcase
Copy link
Member

Not sure what's happening here, I don't get any changes when running make generate locally, I also rebased onto master (which fixed the apidiff issue) any ideas @richardcase @pydctw?

Interesting, i've seen this on another PR. Could you do the following to see if you get a diferent result:

make clean
make generate

@richardcase
Copy link
Member

@charlie-haley - there was an issue with code generation. If you rebase your PR on main this issue with the verify job should go away.

@charlie-haley
Copy link
Contributor Author

@charlie-haley - there was an issue with code generation. If you rebase your PR on main this issue with the verify job should go away.

That did the trick, thanks @richardcase

@mloiseleur
Copy link

@richardcase @pydctw @dlipovetsky Ping for visibility. This PR is ready to be merged.

@richardcase
Copy link
Member

/test ?

@k8s-ci-robot
Copy link
Contributor

@richardcase: The following commands are available to trigger required jobs:

  • /test pull-cluster-api-provider-aws-build
  • /test pull-cluster-api-provider-aws-test
  • /test pull-cluster-api-provider-aws-verify

The following commands are available to trigger optional jobs:

  • /test pull-cluster-api-provider-aws-apidiff-main
  • /test pull-cluster-api-provider-aws-e2e
  • /test pull-cluster-api-provider-aws-e2e-blocking
  • /test pull-cluster-api-provider-aws-e2e-conformance
  • /test pull-cluster-api-provider-aws-e2e-conformance-with-ci-artifacts
  • /test pull-cluster-api-provider-aws-e2e-eks

Use /test all to run the following jobs that were automatically triggered:

  • pull-cluster-api-provider-aws-apidiff-main
  • pull-cluster-api-provider-aws-build
  • pull-cluster-api-provider-aws-test
  • pull-cluster-api-provider-aws-verify

In response to this:

/test ?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@richardcase
Copy link
Member

/test pull-cluster-api-provider-aws-e2e
/test pull-cluster-api-provider-aws-e2e-eks

@richardcase
Copy link
Member

The e2e tests are passing.

Thanks for your work on this @charlie-haley 🙇‍♂️ From my side:

/approve

@dlipovetsky @Ankitasw - any chance you could take a look and when you are happy lgtm?

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: richardcase

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 28, 2022
@Ankitasw
Copy link
Member

@richardcase I will take a look.

Copy link
Member

@Ankitasw Ankitasw left a comment

Choose a reason for hiding this comment

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

nit, otherwise LGTM

Signed-off-by: Charlie Haley <charlie.haley@hotmail.com>
@Ankitasw
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 29, 2022
@k8s-ci-robot k8s-ci-robot merged commit 305244d into kubernetes-sigs:main Jun 29, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.x milestone Jun 29, 2022
@@ -167,6 +168,10 @@ type AWSManagedControlPlaneSpec struct { //nolint: maligned
// +kubebuilder:default=false
DisableVPCCNI bool `json:"disableVPCCNI,omitempty"`

// VpcCni is used to set configuration options for the VPC CNI plugin
// +optional
VpcCni VpcCni `json:"VpcCni,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

@richardcase Ah I haven't noticed that but this should be lowercase.

I'll fix it in my PR. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to add custom environment variables to the aws-node DaemonSet
7 participants