cluster-api-provider-aws icon indicating copy to clipboard operation
cluster-api-provider-aws copied to clipboard

deleting additional vpc cni resources when disabled

Open luthermonson opened this issue 3 years ago • 8 comments
trafficstars

What type of PR is this? /kind bug

What this PR does / why we need it: Adds additional logic to removing vpc-cni pre-installed resources when you set disableVPCCNI to true. Previous logic only deleted the aws-node DaemonSet when in reality there are ServiceAccounts, ClusterRole, ClusterRoleBinding and a CRD.

New logic deletes the SA/CR/CRB but leaves the CRD and any CRs. This is important because some people manage the VPC CNI via the helm chart and with these pieces around the chart fails to install citing the SA/CR/CRB already existing. Additionally... if you choose to disable vpc-cni through capa and install via helm, capa would continually smash it out of existing during reconciliation so added a check for managed-by: Helm

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged): Fixes #3729

Special notes for your reviewer: I tested this pretty thoroughly, check the issue for more details but the basics are this is pretty bullet proof for cycling back/forth from disableVPCCNI to installing the addon again.

Checklist:

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

luthermonson avatar Sep 13 '22 21:09 luthermonson

Hi @luthermonson. 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 avatar Sep 13 '22 21:09 k8s-ci-robot

/ok-to-test

Skarlso avatar Sep 14 '22 05:09 Skarlso

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

luthermonson avatar Sep 14 '22 19:09 luthermonson

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

luthermonson avatar Sep 14 '22 19:09 luthermonson

/hold until https://github.com/kubernetes-sigs/cluster-api-provider-aws/pull/3720 is merged. All upcoming PRs need to be merged once v1beta2 API types are in.

sedefsavas avatar Sep 14 '22 20:09 sedefsavas

/hold cancel

sedefsavas avatar Sep 22 '22 05:09 sedefsavas

/lgtm

Skarlso avatar Oct 12 '22 05:10 Skarlso

/approve

Skarlso avatar Oct 19 '22 09:10 Skarlso

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Skarlso

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 avatar Oct 19 '22 09:10 k8s-ci-robot