config-reloader ContainerPort ignores configReloaderExtraArgs http.listenAddr (hostNetwork port conflict)
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- go, kubernetes
- Ambito
- devops, infrastructure, testing
Direzione di ricerca
Iniziate in internal/controller/operator/factory/build/container.go leggendo ConfigReloaderContainer, addPortProbesToConfigReloaderContainer e ConfigReloaderDefaultPort, quindi esaminate internal/controller/operator/factory/reconcile/config_reload.go per configReloaderMetricsURL. Aggiungete i casi richiesti a container_test.go e verificate che le porte dei container, le probe e il polling delle metriche utilizzino la porta configurata con il fallback e le forme degli indirizzi documentati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
The operator always sets containerPort to the constant 8435 (ConfigReloaderDefaultPort in internal/controller/operator/factory/build/container.go) when building the config-reloader sidecar. Changing the process listen address with spec.configReloaderExtraArgs["http.listenAddr"] updates container args only. Neither containerPort nor the generated HTTP liveness/readiness probes respect the overridden port — both stay locked to 8435, so the kube-scheduler still sees a host port conflict even when the process listens elsewhere.
On nodes with hostNetwork: true, that blocks scheduling a second DaemonSet that also needs a config-reloader: Kubernetes reports that the node did not have free ports for the requested pod ports (didn't have free ports…), even when one process listens on 8435 and another on 8436 via http.listenAddr.
CommonConfigReloaderParams is shared across VMAgent, VMAuth, VMSingle, VMAlertmanager, and VMAlert. The bug lives in the common builder build.ConfigReloaderContainer and affects any component that uses configReloaderExtraArgs to change the listen address.
Environment
- Operator: v0.74.0 (also reproduced in source of v0.74.1, v0.75.0-rc1, and current
masteras of 2026-09-04) - Resources: two
VMAgentDaemonSets withhostNetwork: trueon the same node - Sidecar: default VictoriaMetrics config-reloader
Steps to reproduce
- Deploy two
VMAgentCRs as DaemonSets withhostNetwork: true(and otherwise valid scrape config). - On the second agent, override the reloader listen port, for example:
spec:
hostNetwork: true
configReloaderExtraArgs:
http.listenAddr: "127.0.0.1:8436"
- Observe PodSpec of the second DaemonSet:
config-reloaderstill hascontainerPort: 8435and probes targeting8435, while args include--http.listenAddr=127.0.0.1:8436. - Scheduler fails to place the second pod on a node that already runs the first agent’s reloader on host port 8435.
Expected
ContainerPort and HTTP probe ports for config-reloader should follow the port from configReloaderExtraArgs["http.listenAddr"] when set (with fallback to 8435).
Actual
Process listens on the overridden address (127.0.0.1:8436). PodSpec still declares containerPort: 8435 and probes 8435. Scheduler rejects the pod on a node that already exposes host port 8435 for another agent’s reloader.
Proposed fix
- Parse the port from
ConfigReloaderExtraArgs["http.listenAddr"](support:PORT,IP:PORT,[IPv6]:PORT). - Use that port for
ContainerPortand liveness/readiness probes inaddPortProbesToConfigReloaderContainer(default8435if unset/invalid). - Align scrape endpoint builders that hardcode
8435if they scrape the sidecar by numeric port. - Update
configReloaderMetricsURLininternal/controller/operator/factory/reconcile/config_reload.go, which also hardcodesbuild.ConfigReloaderDefaultPort(8435). Controllers that callWaitForConfigReloadHash(e.g.VMAuth) poll/metricson that URL; when the sidecar listen port is overridden, they keep polling8435and eventually time out.configReloaderMetricsURLshould resolve the configured port the same way asContainerPortand probes. - Add unit tests in
container_test.gofor default, overridden, IPv6, and invalid values.
Related
- VictoriaMetrics/operator#1581 — IPv6 /
enableTCP6/http.listenAddrinteraction (different symptom; related listen-address handling). - VictoriaMetrics/operator#1308 — hardcoded config-reloader probes with proxy-protocol (probe port behavior; not hostNetwork /
ContainerPortscheduling).
Related code
internal/controller/operator/factory/build/container.go:ConfigReloaderDefaultPort,ConfigReloaderContainer,addPortProbesToConfigReloaderContainer
- Lingua principale
- Go
- Stelle
- 603
- Fork
- 242
- Merge medio
- 1g 14h
- PR unite (30g)
- 57
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di VictoriaMetrics/operator
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
VictoriaMetrics/operator#2854 ·
I maintainer di solito rispondono entro 1 giorno
-
VLAgent `spec.k8sCollector.includePodLabels: false` has no effectForse già presa @Haleygo l’ha presa 25 giorni fa. Apertabug waiting for release
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
VictoriaMetrics/operator#2772 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Bug: VMRule `spec.groups[].tenant` should accept an integer, not only a stringForse già presa @megative l’ha presa 40 giorni fa. Apertaenhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
VictoriaMetrics/operator#2608 · 5 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
VMAlert datasource bearer token isn't documentedForse di nuovo libera @Haleygo l’ha presa 35 giorni fa e non c’è nessuna pull request aperta. Apertadocs
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
VictoriaMetrics/operator#2365 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
VictoriaMetrics/operator#2845 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di VictoriaMetrics/operator
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
uselagoon/lagoon-cli#501 · 1 reazione ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
slavakurilyak/awesome-ai-agents#1026 ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Tarektouati/made#197 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100