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

Add node labelling #541

Merged
merged 7 commits into from
May 18, 2022
Merged

Add node labelling #541

merged 7 commits into from
May 18, 2022

Conversation

liger1978
Copy link

Fixes #509

Copy link
Member

@ckotzbauer ckotzbauer left a comment

Choose a reason for hiding this comment

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

Hi @liger1978,
thanks for your PR and working on the issue. This is much appreciated!

Some thoughts to the label-feature:

  • The labels are only added, never removed. The zalando-usecase is toggling the node-label-value. Would it be better to remove the before-labels when the after-labels are applied? I think this is more in line with user expectations.
  • I'm not sure about the cli-flag-names. What about pre-reboot-node-labels and post-reboot-node-labels?

Can you please separate the spelling corrections and readme updates from this PR? It's hard to review, when there are many other changes which aren't directly related to a PR. Please always open separate PRs for that.

Thanks!

/cc @evrardjp @jackfrancis Thoughts?

@liger1978
Copy link
Author

@ckotzbauer I'm not sure what "removing a label" means in this context. In ready state, nodes will already have a label like zalando with a value like ready. Before reboot this must be set to something else, like notready (causing the operator to move the database leader role to a pod on another node). After reboot the label will be set back to ready. I've tested this and it works with the Zalando feature. I'm not sure where you are suggesting a label should be removed in this workflow.

@liger1978
Copy link
Author

@ckotzbauer I've updated the PR with the other requested changes.

@ckotzbauer
Copy link
Member

Thanks for your changes.
What you want (and the zalando-usecase is) is, that you toggle values of the same node-label. However the implementation only adds two sets of labels.
From the wording, I'm not sure if all our users understand that this feature is only really useful if you add pre- and post-labels for the same label-keys.
There are no enforcements that all label-keys from pre-reboot-node-labels are also configured as post-reboot-node-labels. If this is something a component in the cluster (e.g. monitoring) expects, than the reboot is done and the label is still present and indicates a reboot.

@liger1978
Copy link
Author

@ckotzbauer OK, so what would you prefer? Please can you be specific in the behaviour you require as I am struggling to understand what you want (my limitation no doubt).

@ckotzbauer
Copy link
Member

I think the simplest thing would be a validation, that all label-keys set as pre-reboot-label are also set as post-reboot-labels and vice versa. This should also be described at the README.

@liger1978
Copy link
Author

@ckotzbauer I've added the verification and updated the readme as requested.

cmd/kured/main.go Outdated Show resolved Hide resolved
cmd/kured/main.go Outdated Show resolved Hide resolved
cmd/kured/main.go Outdated Show resolved Hide resolved
@liger1978 liger1978 changed the title Add node labelling, correct spellings, update readme Add node labelling May 16, 2022
@liger1978
Copy link
Author

@jackfrancis I have implemented your suggestions.

cmd/kured/main.go Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
Copy link
Member

@ckotzbauer ckotzbauer left a comment

Choose a reason for hiding this comment

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

From my perspective this looks good now. @jackfrancis do you want to have a final look?
I would include this into 1.10.0 if there are not objections.

@ckotzbauer ckotzbauer added this to the 1.10.0 milestone May 17, 2022
Copy link
Collaborator

@jackfrancis jackfrancis left a comment

Choose a reason for hiding this comment

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

lgtm

@liger1978
Copy link
Author

Thanks. Please can it be merged!

@erwbgy
Copy link

erwbgy commented May 18, 2022

@liger1978 One minor niggle. The current implementation has pre-reboot-node-labels and after-reboot-node-labels, which I find confusing. IMO the latter should be post-reboot-node-labels as per the original suggestion from @ckotzbauer.

Or alternatively before-reboot-node-labels and after-reboot-node-labels.

@ckotzbauer
Copy link
Member

Yes, you are right @erwbgy. Thanks for the hint. This should be fixed.

@liger1978
Copy link
Author

@erwbgy @ckotzbauer @jackfrancis I have made this change. Please review/approve/merge. Thank you!

@ckotzbauer ckotzbauer merged commit 48d112b into kubereboot:main May 18, 2022
@liger1978 liger1978 deleted the labels branch May 18, 2022 10:15
@liger1978
Copy link
Author

@ckotzbauer Thank you very much for merging! Do you have any idea when we can expect a new release with these changes included?

@ckotzbauer
Copy link
Member

I think in the next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support node readiness labels
4 participants