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

Do not stop Kubernetes services on node removal if annotation is set. #681

Merged
merged 7 commits into from
Sep 20, 2024

Conversation

bschimke95
Copy link
Contributor

Requires canonical/k8s-snap-api#8 - will update api version tag for the snap afterwards.

By default, all services on a leaving node are stopped. This PR adds logic to skip this step if the k8sd/v1alpha/lifecycle/skip-stop-services-on-remove annotation is set.

This is required for Cluster API to properly drain nodes. See

Also adds an integration test to validate that this works as expected.

@bschimke95 bschimke95 requested a review from a team as a code owner September 18, 2024 19:22
Copy link
Contributor

@HomayoonAlimohammadi HomayoonAlimohammadi left a comment

Choose a reason for hiding this comment

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

Amazing work catching this super subtle issue! Thanks @bschimke95! left some minor comments.

tests/integration/tests/test_clustering.py Outdated Show resolved Hide resolved
src/k8s/pkg/k8sd/app/hooks_remove.go Show resolved Hide resolved
src/k8s/pkg/k8sd/app/hooks_remove.go Outdated Show resolved Hide resolved
Copy link
Contributor

@HomayoonAlimohammadi HomayoonAlimohammadi left a comment

Choose a reason for hiding this comment

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

Wonderful job, thanks a lot @bschimke95! LGTM overall, but left some minor comments.

tests/integration/tests/test_clustering.py Show resolved Hide resolved
tests/integration/tests/test_clustering.py Show resolved Hide resolved
tests/integration/tests/test_clustering.py Show resolved Hide resolved
tests/integration/tests/test_clustering.py Show resolved Hide resolved
@bschimke95 bschimke95 merged commit 27c91c8 into main Sep 20, 2024
20 checks passed
@bschimke95 bschimke95 deleted the KU-1520/slow-node-removal branch September 20, 2024 10:01
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.

2 participants