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

Support the kops.k8s.io/needs-update annotation on nodes #8272

Merged
merged 1 commit into from
Mar 10, 2020

Conversation

johngmyers
Copy link
Member

Adds support for an annotation that nominates nodes for replacement by the kops rolling update mechanism. Possible uses would be external controllers to limit the age of nodes (ref #7411) or to remove unhealthy but still functioning nodes. By having the replacement performed by kops rolling update, it would necessarily coordinate with kops rolling updates and use kops's configured strategy, for example surging when we implement it.

/kind feature
/area rolling-update

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. area/rolling-update cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 4, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @johngmyers. Thanks for your PR.

I'm waiting for a kubernetes 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 4, 2020
@rifelpet
Copy link
Member

rifelpet commented Jan 5, 2020

/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 Jan 5, 2020
@johngmyers
Copy link
Member Author

/retest

2 similar comments
@johngmyers
Copy link
Member Author

/retest

@johngmyers
Copy link
Member Author

/retest

// AdjustNeedUpdate adjusts the set of instances that need updating, using factors outside those known by the cloud implementation
func (c *RollingUpdateCluster) AdjustNeedUpdate(groups map[string]*cloudinstances.CloudInstanceGroup, cluster *api.Cluster, instanceGroups *api.InstanceGroupList) error {
for _, group := range groups {
if group.Ready != nil {
Copy link
Member

Choose a reason for hiding this comment

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

FYI for reads golang treats a nil slice as empty, so I don't think you actually need this check. Arguably it does make things clearer though!

var newReady []*cloudinstances.CloudInstanceGroupMember
for _, member := range group.Ready {
makeNotReady := false
if member.Node != nil && member.Node.Annotations != nil {
Copy link
Member

Choose a reason for hiding this comment

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

(And FYI the same applies to nil maps, for reading - though not for writing, so again you don't need the Annotations != nil check)

@justinsb
Copy link
Member

A tip about nil slices & maps, but this LGTM. Thanks @johngmyers

Unfortunately I think we've conflicted on a doc file, so I suspect I'll need to re-apply lgtm.

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 10, 2020
@k8s-ci-robot k8s-ci-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Mar 10, 2020
@justinsb
Copy link
Member

Thanks for rebasing!

/approve
/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: johngmyers, justinsb

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 merged commit 8ecc5ed into kubernetes:master Mar 10, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.18 milestone Mar 10, 2020
@johngmyers johngmyers deleted the need-update-annotation branch March 10, 2020 17:37
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. area/rolling-update 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. 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.

None yet

4 participants