fix(k8s): make node metrics listener configurable - #355
Open
jiangqiao2 wants to merge 2 commits into
Open
jiangqiao2 wants to merge 2 commits into
jiangqiao2 wants to merge 2 commits into
Conversation
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.
Problem
The Kubernetes Node DaemonSet runs with
hostNetwork: true, while the Edge diagnostics/metrics listener was hard-coded to:9101. If the target node already has a host-levelongrid-edgeprocess or another exporter using that port, the Node Edge fails to start and entersCrashLoopBackOff.Reproduced in production: the host-level Edge was already listening on
:9101, preventing the Kubernetes Node Edge from starting.Fixes #261
Changes
ONGRID_EDGE_METRICS_ADDRenvironment variable. The default remains:9101for backward compatibility.node.metricsAddrand injected it into the Node DaemonSet.Verification
git diff --checkgo test ./cmd/ongrid-edgemake test-k8s-chartnode.metricsAddr=:19101, the Node reached1/1 Running;:19101and the existing:9101listener operated simultaneously.The local environment did not have Go or Helm installed. Unit tests and chart validation were completed on the target server with Go 1.25 and Helm.
Port Configuration
The Node DaemonSet uses
hostNetwork: trueand listens on:9101by default. If another service is using that port on a node, specify an unused port:The value can also be set in
values.yaml:The selected port must be available on the host of every Kubernetes node.