Visitar URL original
Cease posting the logs as k8s events out-of-the-box by nolar · Pull Request #1258 · nolar/kopf · GitHub
Skip to content

Cease posting the logs as k8s events out-of-the-box - #1258

Merged
nolar merged 1 commit into
mainfrom
no-log-posting
Mar 9, 2026
Merged

nolar merged 1 commit into
mainfrom
no-log-posting

Conversation

@nolar

@nolar nolar commented Feb 28, 2026 •

Copy link
Copy Markdown
Owner

In line with the goal of preparing Kopf to run on large cluster with high-load activity, disable the automatic posting of log messages as k8s events to relevant resources. Such posting creates unnecessary load on Kubernetes API servers with little or no benefit. These events include mainly the handler successes/failures and are of little interest. Logs should remain just the logs by default, i.e. out of the box. They should not map to k8s events. For k8s events, there are explicitly posting routines.

This change is slightly backwards incompatible (changes the existing behaviour), but no major release is needed.

To revert: If needed, the operator can enable this functionality by setting settings.posting.loggers = True in an on-startup handler.

import kopf

@kopf.on.startup
def configure(settings, **_):
    settings.posting.loggers = True

Not affected: The explicit event posting via kopf.event(), kopf.info(), kopf.warn(), kopf.exception() remains unaffected (controlled by settings.posting.enabled = True by default). Related:

@nolar nolar added the enhancement New feature or request label Feb 28, 2026
@nolar nolar changed the title Disable out-of-the-box posting of log messages as k8s events Cease posting the logs as k8s events out-of-the-box Feb 28, 2026
@nolar
nolar force-pushed the no-log-posting branch 3 times, most recently from eef9f96 to abb4f95 Compare March 1, 2026 08:56
In line with the goal of preparing Kopf to run on large cluster with high-load activity, disable the automatic posting of log messages as k8s events to relevant resources. Such posting creates unnecessary load on Kubernetes API servers with little or no benefit. These events include mainly the handler successes/failures and are of little interest. Logs should remain just the logs by default, i.e. out of the box. They should not map to k8s events. For k8s events, there are explicitly posting routines.

This change is slightly backwards incompatible (changes the existing behaviour), but no major release is needed.

**To revert:** If needed, the operator can enable this functionality by setting `settings.posting.loggers = True` in an on-startup handler.

**Not affected:** The explicit event posting via `kopf.event()`, `kopf.info()`, `kopf.warn()`, `kopf.exception()` remains unaffected (controlled by `settings.posting.enabled = True` by default).

Signed-off-by: Sergey Vasilyev <nolar@nolar.info>
@nolar
nolar merged commit 547fcf9 into main Mar 9, 2026
27 checks passed
@nolar
nolar deleted the no-log-posting branch March 9, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant