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

Issue #1609 - Handling Cluster AutoScaler Taint to determine the healthiness of node #1688

Merged
merged 3 commits into from
Jan 1, 2021
Merged

Issue #1609 - Handling Cluster AutoScaler Taint to determine the healthiness of node #1688

merged 3 commits into from
Jan 1, 2021

Conversation

atulaggarwal
Copy link
Contributor

Issue #1609 - Checking if the current node is tainted with ClusterAutoScaler and avoid marking that node as healthy so that it could be removed from load balancer target groups. This PR also adds node.Spec.UnSchedulable check as present in master branch too.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 25, 2020
@atulaggarwal
Copy link
Contributor Author

@kishorj - Can you look at the PR and let me know if this looks fine? I needed to add IsNodeSuitableForTraffic function in main branch which was already present in master branch.

// IsNodeReady returns whether node is ready.
func IsNodeReady(node *corev1.Node) bool {
nodeReadyCond := GetNodeCondition(node, corev1.NodeReady)
return nodeReadyCond != nil && nodeReadyCond.Status == corev1.ConditionTrue
}

// IsNodeSuitableAsTrafficProxy check whether node is suitable as a traffic proxy.
// mimic the logic of serviceController: https://github.com/kubernetes/kubernetes/blob/b6b494b4484b51df8dc6b692fab234573da30ab4/pkg/controller/service/controller.go#L605
func IsNodeSuitableForTraffic(node *corev1.Node) bool {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit, the comment of function is "IsNodeSuitableAsTrafficProxy", maybe change this function to be "IsNodeSuitableAsTrafficProxy".

@@ -6,12 +6,34 @@ import (
"strings"
)

const (
toBeDeletedTaint = "ToBeDeletedByClusterAutoscaler"
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit, maybe change to toBeDeletedByCATaint.

Copy link
Collaborator

@M00nF1sh M00nF1sh left a comment

Choose a reason for hiding this comment

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

looks good to me with nit comments 👍
/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Dec 11, 2020
@atulaggarwal
Copy link
Contributor Author

Changes done as per comments.

@codecov-io
Copy link

Codecov Report

Merging #1688 (2c92830) into main (a08ca0d) will increase coverage by 0.42%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1688      +/-   ##
==========================================
+ Coverage   46.34%   46.76%   +0.42%     
==========================================
  Files         110      110              
  Lines        5957     5989      +32     
==========================================
+ Hits         2761     2801      +40     
+ Misses       2930     2923       -7     
+ Partials      266      265       -1     
Impacted Files Coverage Δ
pkg/backend/endpoint_resolver.go 64.55% <100.00%> (ø)
pkg/k8s/node_utils.go 100.00% <100.00%> (ø)
pkg/service/model_build_load_balancer.go 83.01% <0.00%> (+0.32%) ⬆️
pkg/ingress/model_builder.go 55.90% <0.00%> (+0.62%) ⬆️
pkg/service/model_builder.go 78.72% <0.00%> (+0.94%) ⬆️
pkg/ingress/model_build_load_balancer.go 48.01% <0.00%> (+2.29%) ⬆️
pkg/ingress/model_build_target_group.go 72.46% <0.00%> (+2.81%) ⬆️
pkg/ingress/model_build_managed_sg.go 67.79% <0.00%> (+7.08%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a08ca0d...2c92830. Read the comment docs.

// IsNodeSuitableAsTrafficProxy check whether node is suitable as a traffic proxy.
// mimic the logic of serviceController: https://github.com/kubernetes/kubernetes/blob/b6b494b4484b51df8dc6b692fab234573da30ab4/pkg/controller/service/controller.go#L605
func IsNodeSuitableAsTrafficProxy(node *corev1.Node) bool {
if node.Spec.Unschedulable {
Copy link
Collaborator

@M00nF1sh M00nF1sh Dec 30, 2020

Choose a reason for hiding this comment

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

we shouldn't check for Unschedulable anymore.(it's removed from latest k8s of whether it should be a criteria for LB node pool)

Added a commit to this PR to remove it :D

Copy link
Collaborator

@M00nF1sh M00nF1sh left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 30, 2020
@M00nF1sh M00nF1sh removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 30, 2020
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 30, 2020
@M00nF1sh
Copy link
Collaborator

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 30, 2020
@M00nF1sh
Copy link
Collaborator

/label tide/merge-method-squash

@k8s-ci-robot k8s-ci-robot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Dec 30, 2020
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 30, 2020
@M00nF1sh
Copy link
Collaborator

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: atulaggarwal, M00nF1sh
To complete the pull request process, please assign after the PR has been reviewed.
You can assign the PR to them by writing /assign in a comment when ready.

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

@M00nF1sh M00nF1sh merged commit e3f990a into kubernetes-sigs:main Jan 1, 2021
Timothy-Dougherty pushed a commit to adammw/aws-load-balancer-controller that referenced this pull request Nov 9, 2023
…ermine the healthiness of node (kubernetes-sigs#1688)

* Issue kubernetes-sigs#1609. Checking for taint ToBeDeletedByClusterAutoscaler while checking if node is suitable to handle traffic.

* Changes as per the PR comments.

* remove unschedulable from LB node pool critera

Co-authored-by: M00nF1sh <yyyng@amazon.com>
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants