Add flags to disable irrelevant integrations#328
Open
gecube wants to merge 1 commit into
Open
Conversation
Some nodes never have a given integration and the agent shouldn't spend time probing it or reporting it as unavailable. Add opt-in switches to skip them: - --no-docker don't probe the Docker daemon socket - --no-systemd don't query systemd unit properties over D-Bus - --no-journald don't read the systemd journal - --no-cilium don't attach to Cilium eBPF maps - --no-cloud-metadata don't query the cloud metadata service Defaults keep the current behavior: every integration is auto-detected per node. This is deliberately the recommended mode for hybrid clusters (several clouds + bare metal under one control plane) — a single DaemonSet works everywhere without per-node configuration. The flags are escape hatches for homogeneous node pools (typically deployed as a pool-scoped DaemonSet) or locked-down/misdetected environments. --provider now also forces the metadata service of the given provider to be queried, overriding auto-detection, so a real cloud node whose DMI is not readable still gets its instance metadata. An empty value keeps per-node auto-detection. Cilium map probing is moved out of a package init() into InitCilium(), called after flag parsing from NewRegistry, so it can be gated by --no-cilium and lines up with how the other integrations are initialized. Signed-off-by: George Gaál <gb12335@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds opt-in flags to skip integrations that are irrelevant on a given node, so the agent doesn't probe them or report them as unavailable. Companion to #327 (which quiets the benign log lines); this PR lets operators turn the probes off entirely.
New flags (all default to current behavior — auto-detect):
--no-dockerNO_DOCKER--no-systemdNO_SYSTEMD--no-journaldNO_JOURNALD--no-ciliumNO_CILIUM--no-cloud-metadataNO_CLOUD_METADATAHybrid clusters. Defaults are unchanged: every integration is auto-detected per node, and the cloud provider is detected from DMI per node. That is deliberately the recommended mode for clusters spanning several clouds and bare metal — a single DaemonSet works everywhere. The flags are escape hatches for homogeneous node pools (typically deployed as a pool-scoped DaemonSet via
nodeSelector) or locked-down / misdetected environments.--providernow forces the probe. Previously--provideronly set thenode_cloud_infolabel. It now also forces the metadata service of that provider to be queried, overriding auto-detection, so a real cloud node whose DMI is not readable still gets its instance metadata. An empty value keeps per-node auto-detection.Cilium init. The Cilium map probing is moved out of a package
init()intoInitCilium(), called after flag parsing fromNewRegistry— so it can be gated by--no-ciliumand lines up with how the other integrations (docker/containerd/cri-o/journald) are already initialized.No behavior change with default flags; builds for linux and windows.