-
Notifications
You must be signed in to change notification settings - Fork 39.7k
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
Deprecate Kubelet RunOnce mode #125649
Deprecate Kubelet RunOnce mode #125649
Conversation
/hold |
5489da7
to
804ac2e
Compare
/retest |
2 similar comments
/retest |
/retest |
cmd/kubelet/app/server.go
Outdated
if !utilfeature.DefaultFeatureGate.Enabled(features.LegacyNodeRunOnceMode) { | ||
panic("Cannot run runonce mode when LegacyNodeRunOnceMode feature gate is disabled") | ||
} | ||
klog.InfoS("WARNING: RunOnce mode has been deprecated, and will be removed in a future release") |
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.
As mentioned in the KEP-4580, why don't you log this as a warning level message?
klog.InfoS("WARNING: RunOnce mode has been deprecated, and will be removed in a future release") | |
klog.Warning("WARNING: RunOnce mode has been deprecated, and will be removed in a future release") |
I was just wondering, if kubelet's log level is set to error or higher, the deprecation warning is missed. Should we consider always writing deprecation message without relying on klog? Never mind, since klog only has the -v
option, it will probably always be logged even with -v=0
.
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.
As mentioned in the KEP-4580, why don't you log this as a warning level message?
This is what I originally wanted to do, but lint
doesn't like the warning
function, so I chose to use InfoS
instead.
If the PR is approved, I will modify the KEP
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.
Could just make it an error.
klog.InfoS("WARNING: RunOnce mode has been deprecated, and will be removed in a future release") | |
klog.ErrorS("RunOnce mode is deprecated, and will be removed in a future release") |
/retest |
Hi @HirazawaUi, I'm Abbie the comms lead for 1.31. Can you share the status of this PR? We are close to publishing the mid-cycle blog and this deprecation is listed. I'd like to make sure we should still include this in the blog. Also, can you make sure this PR is linked in kubernetes/enhancements#4580? thanks! cc: @neoaggelos |
@a-mccarthy This PR is waiting for review. I will remind the reviewer of sig-node to review it later in slack. |
added. |
/cc @tallclair |
cmd/kubelet/app/server.go
Outdated
if !utilfeature.DefaultFeatureGate.Enabled(features.LegacyNodeRunOnceMode) { | ||
panic("Cannot run runonce mode when LegacyNodeRunOnceMode feature gate is disabled") | ||
} | ||
klog.InfoS("WARNING: RunOnce mode has been deprecated, and will be removed in a future release") |
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.
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.
@HirazawaUi Also, we should adjust the language to encourage migrating to alternatives covered in the KEP for this.
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, we should adjust the language to encourage migrating to alternatives covered in the KEP for this.
Added. Do you think we should add the URL for podman kube? (I believe it's not necessary because the URL for podman kube might change).
/triage accepted |
317d21c
to
7411183
Compare
/test pull-kubernetes-unit |
Unlike the |
@@ -1260,6 +1260,10 @@ func RunKubelet(ctx context.Context, kubeServer *options.KubeletServer, kubeDeps | |||
|
|||
// process pods and exit. | |||
if runOnce { | |||
if !utilfeature.DefaultFeatureGate.Enabled(features.LegacyNodeRunOnceMode) { | |||
panic("Cannot run runonce mode when LegacyNodeRunOnceMode feature gate is disabled") |
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.
panic will dump a backtrace - is that really what we need? It will appear to users as a bug or crash.
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.
It's not uncommon for panic
to occur in kubelet, a similar use cases like:
kubernetes/pkg/kubelet/status/status_manager.go
Lines 199 to 207 in 0caeba5
if utilfeature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScaling) { | |
stateImpl, err := state.NewStateCheckpoint(m.stateFileDirectory, podStatusManagerStateFile) | |
if err != nil { | |
// This is a crictical, non-recoverable failure. | |
klog.ErrorS(err, "Could not initialize pod allocation checkpoint manager, please drain node and remove policy state file") | |
panic(err) | |
} | |
m.state = stateImpl | |
} |
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.
I leave this for.kubele reviewers, but IMO panic is not a very obvious failure mechanism
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.
yeah I agree that panic is a bit much. Can you exist with an error and log an error instead? Personally I think panics should be reserved for coding errors, whereas this is a configuration error.
pkg/features/kube_features.go
Outdated
@@ -1066,6 +1073,8 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS | |||
|
|||
LegacyServiceAccountTokenCleanUp: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // GA in 1.30; remove in 1.32 | |||
|
|||
LegacyNodeRunOnceMode: {Default: true, PreRelease: featuregate.Alpha}, |
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.
It describes how to deprecate with gates (though in this case you want to start with it enabled, to satisfy deprecation policy)
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.
I would leave a TODO here to change default to false in or after 1.34
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.
It describes how to deprecate with gates (though in this case you want to start with it enabled, to satisfy deprecation policy)
Thanks for the reminder.
I would leave a TODO here to change default to false in or after 1.34
Since the KEP describes that it will be set to false by default in v1.32, I have added comment according to the KEP.
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.
The deprecation policy is a little vague about this. It says "Deprecated behaviors must function for no less than 1 year after their announced deprecation." Do we think that "function" means "by default" or "with effort" ?
My read of it was "by default"
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.
All right, I have updated the comment.
7411183
to
03ba8f3
Compare
03ba8f3
to
bf3f2c5
Compare
PR needs rebase. 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-sigs/prow 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.
LGTM if OK with node folks
/approve
/hold
Clear hold when fully reviewed
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: HirazawaUi, thockin 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 |
can you update the merge conflict too please @HirazawaUi ? |
/close |
@HirazawaUi: Closed this PR. In response to this:
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-sigs/prow repository. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Deprecate kubelet support for RunOnce mode.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: