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

2845: klog flag deprecation: clarify scope and timeline #3033

Merged
merged 1 commit into from Jan 14, 2022

Conversation

pohly
Copy link
Contributor

@pohly pohly commented Nov 2, 2021

  • One-line PR description: clarify scope and timeline: removal in 1.26
  • Other comments: Deprecating the flags only in some binaries is not going far enough because the full feature set would still have to be supported for the remaining ones.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 2, 2021
@k8s-ci-robot k8s-ci-robot added kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. labels Nov 2, 2021
@pohly
Copy link
Contributor Author

pohly commented Nov 2, 2021

/cc @kubernetes/wg-structured-logging-members

@serathius
Copy link
Contributor

/lgtm
/assign @ehashman @dims

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 2, 2021
period](https://kubernetes.io/docs/reference/using-api/deprecation-policy/#deprecating-a-flag-or-cli)
starts
- Kubernetes 1.24 (tentative): beta
- Kubernetes 1.25 (tentative): GA, deprecated flags get removed
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I hope I understood the "available for two releases" rule correctly (https://kubernetes.io/docs/reference/using-api/deprecation-policy/#deprecating-a-flag-or-cli): 1.23 and 1.24 still have them, 1.25 won't.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We'll also have to check the "for one year" rule. But we can discuss that when we get closer to the actual removal.

Copy link
Member

Choose a reason for hiding this comment

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

I think this is an okay tentative timeline, but given how long these flags have been present, we may want to wait until 1.26 for removal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd prefer to remove them as soon as possible because the code for supporting them during the transition is really ugly. Can we keep 1.25 as tentative and check again when we are closer to that to determine whether we can go ahead?

Copy link
Member

Choose a reason for hiding this comment

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

Per the linked policy + discussion with @logicalhan on today's triage, https://kubernetes.io/docs/reference/using-api/deprecation-policy/#deprecating-a-flag-or-cli states 12 months or 2 releases, whichever is longer - I think it has to be 1.26.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I find that rule ambiguous because it's unclear which releases are counted for that "2 releases" check.

But let's be conservative and aim for 1.26. Commit and PR description was updated.

them with defaults. From klog flags we would remove all flags besides "-v"
and "-vmodule".
We propose to remove klog specific feature flags in Kubernetes components
(including, but not limited to, kube-apiserver, kube-scheduler,
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to confirm, this extends the previous list of components to projects owned by K8s Org. In more detail, components that use kubernetes/component-base/logs, which also include kube-proxy, cluster-autoscaler etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Everything that uses kubernetes/component-base/logs to add klog flags worked without modifications, so sig-instrumentation doesn't need to do additional work because of this increased scoped.

Moving some options into LoggingConfiguration is more intrusive, but only a few commands use that, so it's still doable.

Copy link
Contributor

Choose a reason for hiding this comment

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

Important thing to note kubernetes/component-base/logs is used by non-Kubernetes Org projects, we didn't give any compatibility promises, but I expect some people will not be happy. Possibly this could be solved with proper documentation that would describe how those project could directly use klog.

Choose a reason for hiding this comment

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

Important thing to note kubernetes/component-base/logs is used by non-Kubernetes Org projects, we didn't give any compatibility promises, but I expect some people will not be happy. Possibly this could be solved with proper documentation that would describe how those project could directly use klog.

Would it make sense to add something about this to alpha or beta graduation criteria? All we have is Documentation on migrating off klog flags is publicly available but that doesnt seem to cover @serathius suggestion above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Where would such documentation live? A blog post describing the recent changes?

There's the API documentation in gopkg. Do we need more than that?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah this would need to go on the blog at minimum. Ensure we are engaging the comms team.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can write a blog post and submit a talk for the next KubeCon.

them with defaults. From klog flags we would remove all flags besides "-v"
and "-vmodule".
We propose to remove klog specific feature flags in Kubernetes components
(including, but not limited to, kube-apiserver, kube-scheduler,
Copy link
Member

Choose a reason for hiding this comment

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

Yeah this would need to go on the blog at minimum. Ensure we are engaging the comms team.

Comment on lines +275 to +276
- Kubernetes logging configuration is completely stored in one struct
(`LoggingConfiguration`) before being applied to the process.
Copy link
Member

Choose a reason for hiding this comment

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

We removed the line "drops global state", I assume this is the substitute. Are we still doing that? If so, can we provide a bit more detail about the global state this is replacing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As long as we have klog, there is going to be global state in klog (the global logger and its configuration). There's no way around that in alpha and later because this KEP isn't about removing klog.

I discussed this with @serathius in https://kubernetes.slack.com/archives/C020CCMUEAX/p1635445845031900 and he explained that the intention was to treat all logging configuration as local state until applied to the process, so the "stored in one struct" line item is the replacement for "drops global state".

- Go-runner is feature complementary to klog flags planned for deprecation
- Projects in Kubernetes Org are migrated to go-runner
- JSON logs format splits stdout and stderr logs
- The klog flags which will be removed are marked as deprecated in command line
help output and the deprecation is announced in the Kubernetes release notes.
Copy link
Member

Choose a reason for hiding this comment

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

👍

period](https://kubernetes.io/docs/reference/using-api/deprecation-policy/#deprecating-a-flag-or-cli)
starts
- Kubernetes 1.24 (tentative): beta
- Kubernetes 1.25 (tentative): GA, deprecated flags get removed
Copy link
Member

Choose a reason for hiding this comment

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

I think this is an okay tentative timeline, but given how long these flags have been present, we may want to wait until 1.26 for removal.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 19, 2021
Deprecating the flags only in some binaries is not going far enough because the
full feature set would still have to be supported for the remaining ones. The
goal was to remove them everywhere and the KEP gets updated to reflect that.

Because of the deprecation period for command line flags we want to announce
the intent to deprecate as soon as possible. The proposal is to do it already
at the alpha stage in Kubernetes 1.23. Most of the work is done or can be
completed.

Depending on the interpretation of "must function for 2 releases after their
announced deprecation" (does that include the release for which the announcement
was made?) we might be able to remove in 1.25. But to be safe and also to
ensure the "for 12 months" rule, we aim for removal in 1.26.
@pohly
Copy link
Contributor Author

pohly commented Dec 9, 2021

@ehashman: did I address your concerns? The flags are now listed as "to be removed in 1.26".

Copy link
Member

@ehashman ehashman left a comment

Choose a reason for hiding this comment

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

/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 Jan 14, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ehashman, pohly

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 14, 2022
@k8s-ci-robot k8s-ci-robot merged commit 6ec5481 into kubernetes:master Jan 14, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.24 milestone Jan 14, 2022
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants