-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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 ability to configure kubeadm's ignored pre-flight errors via InitConfiguration and JoinConfiguration #75499
Add ability to configure kubeadm's ignored pre-flight errors via InitConfiguration and JoinConfiguration #75499
Conversation
Hi @marccarre. 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 Once the patch is verified, the new status will be reflected by the 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the PR @marccarre
i think, this is pretty much what we want to do, except that it has to happen in v1beta2.
/assign @rosti @fabriziopandini
/hold
@marccarre |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution @marccarre !
The thing is that we should not modify the existing v1beta1 config. We have to do that modification in the new v1beta2 config if we reach a consensus on that.
Also, my proposition is to have that field in the NodeRegistrationOptions
only.
Let's hold this for now, until the time comes for it.
/hold
@rosti, @neolit123, thanks for your feedback ✨ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating this @marccarre !
However, we need to hold on until the new config (probably v1beta2) becomes available. More developments on this question are to come probably next week.
We need to add the new field in that config and the internal one (not in v1beta1 or v1alpha3).
I'll ping you for a rebase and more guidance once we are ready for this.
It's just that we need to do a few more things before we can proceed with this.
Sure, no worries. I'll wait then 🙂 I haven't dug into the code generation logic (yet), but I'm guessing some of the build issues I'm seeing will change/disappear once |
Mostly yes. |
@marccarre, with the merger of #76710 you are now able to continue working on this based on v1beta2. |
I thought about this PR, and I think the better way to implement that will be to modify |
@rosti, @fabriziopandini, @neolit123, @kad, I've just rebased this PR on top of latest |
Please squash commits. One for implementation/code changes part, one commit for auto-generated stuff. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update @marccarre !
So far it looks great!
However, we need to deny the ability to specify "all" in the config file (but still permit it in the command line). Once that is done we can merge it.
/ok-to-test |
That's one way of doing it. |
This will require third iteration over the combined set with check, for mixture or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nits
return nil, err | ||
} | ||
// Also set the union of pre-flight errors to InitConfiguration, to provide a consistent view of the runtime configuration: | ||
cfg.NodeRegistration.IgnorePreflightErrors = ignorePreflightErrorsSet.List() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also nit: do we have usage of this somewhere? Otherwise we are loosing prestine state as we read from config file, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is currently not used anywhere, but given the configuration object is passed around, and this field could eventually be used elsewhere as a result, I thought doing the above might reduce the chance of a bug/inconsistent behaviour. I can remove it if you'd rather keep the configuration file's initial state. Let me know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @marccarre !
A couple of nits and we are there!
Ok, the fuzzer test is failing, because we don't have the func fuzzNodeRegistration(obj *kubeadm.NodeRegistrationOptions, c fuzz.Continue) {
c.FuzzNoCustom(obj)
// Pinning values for fields that get defaults if fuzz value is empty string or nil (thus making the round trip test fail)
obj.IgnorePreflightErrors = nil
} Also, the reset test needs fixing (missing parameter in the call to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @marccarre !
I am happy how things turned out. Can you squash your commits as a final step so we can merge it?
/approve
/hold
For the squash.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: marccarre, rosti 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 |
Specifically, IgnorePreflightErrors in {Init,Join}Configuration's NodeRegistrationOptions can be used to achieve this. See also: https://docs.google.com/document/d/1XnP67oO1i9VcDIpw42IzptnJsc5OQM-HTf8cVcjCR2w/edit
This commit contains only changes generated by the build process. Nothing here was manually changed. Changes made to: ``` cmd/kubeadm/app/apis/kubeadm/validation/BUILD cmd/kubeadm/app/cmd/BUILD ``` were generated by running: ```` ./hack/update-bazel.sh ```
Done: PR rebased on top of latest |
/lgtm |
/retest Review the full test history for this PR. Silence the bot with an |
1 similar comment
/retest Review the full test history for this PR. Silence the bot with an |
This fixes possible problems when kubeadm upgrade can't load the InitConfig properly. Some new code introduced in kubernetes#75499 is placed between the loading of the config and the error handling, hiding possible errors. This error cannot be ignored (as is the case now), since the cfg ptr. returned from the configutil function will be nil in the case of an error. Signed-off-by: Odin Ugedal <[email protected]>
What type of PR is this?
/kind feature
/sig cluster-lifecycle
What this PR does / why we need it:
This adds a more declarative way to configure ignored pre-flight errors -- via
InitConfiguration
andJoinConfiguration
, in addition to the "legacy" CLI flag -- and therefore simplifies programmatic usage ofkubeadm
: just one configuration file to generate & to pass tokubeadm
.Which issue(s) this PR fixes:
Fixes #74246.
Fixes kubernetes/kubeadm/issues/1460.
Does this PR introduce a user-facing change?: