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

delete AKS extensions when they are removed from spec #5139

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nojnhuh
Copy link
Contributor

@nojnhuh nojnhuh commented Sep 19, 2024

What type of PR is this?
/kind bug

What this PR does / why we need it:

Lately our AKS e2e test has been flakily timing out when deleting the cluster. The cause according to #5120 is that the traefik extension is failing to delete, which seems to only happen when the extension's Pod is running on a Windows Node. Even though the e2e test creates a taint on the Windows nodepool to prevent this, the taint is removed before the k8s version upgrades take place which recycles all the nodes and causes pods to be rescheduled.

This change makes it possible to remove elements from an AzureManagedControlPlane's spec.extensions and the removed extensions will be deleted from the AKS cluster. This enables the e2e test to remove the extensions it adds before dropping the taint on the Windows nodepool to ensure traefik is never running on a Windows Node.

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 #

Special notes for your reviewer:

  • cherry-pick candidate

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

AKS extensions removed from an AzureManagedControlPlane's `spec.extensions` will now be deleted.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 19, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from nojnhuh. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 19, 2024
@nojnhuh
Copy link
Contributor Author

nojnhuh commented Sep 19, 2024

/assign @willie-yao

Copy link

codecov bot commented Sep 19, 2024

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Project coverage is 51.24%. Comparing base (fc938f4) to head (cccdcd5).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
azure/services/aksextensions/aksextensions.go 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5139      +/-   ##
==========================================
- Coverage   51.25%   51.24%   -0.01%     
==========================================
  Files         273      273              
  Lines       24651    24656       +5     
==========================================
+ Hits        12634    12636       +2     
- Misses      11231    11234       +3     
  Partials      786      786              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

svc.Specs = scope.AKSExtensionSpecs()
svc.ConditionType = infrav1.AKSExtensionsReadyCondition
return &Service{
Scope: scope,
Service: svc,
}
}

func list(ctx context.Context, client client.Client, opts ...client.ListOption) ([]*asokubernetesconfigurationv1.Extension, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Can you name this to something more descriptive like listAKSExtensions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does the signature and this existing in the aksextensions package make that clear? I've been trying to optimize these for copy-paste-ability since it's pretty much the same between all the ASO services so adding the type again here would be one more place to change.

Copy link
Contributor

Choose a reason for hiding this comment

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

sounds good to me!

Copy link
Contributor

@willie-yao willie-yao left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 19, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: fa04ebf3c6227bd3404783a1effbf5de28ff7ae3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants