Skip to content

Conversation

@niladrih
Copy link
Member

Pull Request template

Why is this PR required? What issue does it fix?:
Fixes #279

What this PR does?:
This change adds a custom Warning logger to the kubernetes REST client, so that warning logs are duplicated and they don't flood the logs.
Adds a CLI flag --dedupe-warnings to enable this option.
Adds a helm chart value localpv.logging.dedupeWarnings=true to use the above flag.

Does this PR require any upgrade changes?:
Nope

If the changes in this PR are manually verified, list down the scenarios covered::
Verified in kubernetes v1.33.0 (minikube) that there is indeed a flood of warnings related to the use of Endpoints instead of EndpointSlices. Used the flag with the helm chart and verified that a single log is present the next time round.

Any additional information for your reviewer? :
Mention if this PR is part of any design or a continuation of previous PRs

Checklist:

  • Fixes #
  • PR Title follows the convention of <type>(<scope>): <subject>
  • Has the change log section been updated?
  • Commit has unit tests
  • Commit has integration tests
  • (Optional) Are upgrade changes included in this PR? If not, mention the issue/PR to track:
  • (Optional) If documentation changes are required, which issue on https://github.com/openebs/openebs-docs is used to track them:

PLEASE REMOVE BELOW INFORMATION BEFORE SUBMITTING

The PR title message must follow convention:
<type>(<scope>): <subject>.

Where:
Most common types are:
* feat - for new features, not a new feature for build script
* fix - for bug fixes or improvements, not a fix for build script
* chore - changes not related to production code
* docs - changes related to documentation
* style - formatting, missing semi colons, linting fix etc; no significant production code changes
* test - adding missing tests, refactoring tests; no production code change
* refactor - refactoring production code, eg. renaming a variable or function name, there should not be any significant production code changes
* cherry-pick - if PR is merged in master branch and raised to release branch(like v0.4.x)

IMPORTANT: Please review the CONTRIBUTING.md file for detailed contributing guidelines.

@niladrih niladrih requested a review from a team as a code owner July 24, 2025 10:02
@niladrih niladrih force-pushed the endpointslices-warnings branch 4 times, most recently from a792a31 to 503befd Compare July 24, 2025 11:12
@niladrih niladrih force-pushed the endpointslices-warnings branch from 503befd to fa4e397 Compare July 25, 2025 05:46
if dedupeWarnings {
rest.SetDefaultWarningHandler(
rest.NewWarningWriter(logger.KlogWarner{}, rest.WarningWriterOptions{
Deduplicate: true,
Copy link
Member

Choose a reason for hiding this comment

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

Is this a brute force dedup of all warnings?
What's the memory usage impact of this?

name: openebs-localpv-provisioner
logging:
# Disable duplicate warning messages
dedupeWarnings: false
Copy link
Member

Choose a reason for hiding this comment

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

Should it not be enabled by default then?

Copy link
Member Author

Choose a reason for hiding this comment

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

I suppose it's more expected that errors and warnings show up repeatedly in kubernetes controllers.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warnings about accessing Endpoints instead of EndpointSlices on Kubernetes v1.33+

4 participants