config-reloader ContainerPort ignores configReloaderExtraArgs http.listenAddr (hostNetwork port conflict)
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- go, kubernetes
- Domain
- devops, infrastructure, testing
Research direction
Start in internal/controller/operator/factory/build/container.go by reading ConfigReloaderContainer, addPortProbesToConfigReloaderContainer, and ConfigReloaderDefaultPort, then inspect internal/controller/operator/factory/reconcile/config_reload.go for configReloaderMetricsURL. Add the requested cases to container_test.go and verify that container ports, probes, and metrics polling use the configured port with the documented fallback and address forms.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Go
- Stars
- 603
- Forks
- 242
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 57
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from VictoriaMetrics/operator
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
VictoriaMetrics/operator#2854 ·
Maintainers usually reply within 1 day
-
VLAgent `spec.k8sCollector.includePodLabels: false` has no effectPossibly taken @Haleygo claimed this 25 days ago. Openbug waiting for release
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
VictoriaMetrics/operator#2772 · 1 assignee ·
Maintainers usually reply within 1 day
-
Bug: VMRule `spec.groups[].tenant` should accept an integer, not only a stringPossibly taken @megative claimed this 40 days ago. Openenhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
VictoriaMetrics/operator#2608 · 5 comments ·
Maintainers usually reply within 1 day
-
VMAlert datasource bearer token isn't documentedMay be free again @Haleygo claimed this 35 days ago, and no pull request is open. Opendocs
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
VictoriaMetrics/operator#2365 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
VictoriaMetrics/operator#2845 ·
Maintainers usually reply within 1 day
All issues in VictoriaMetrics/operator
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
uselagoon/lagoon-cli#501 · 1 reaction ·
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
slavakurilyak/awesome-ai-agents#1026 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Tarektouati/made#197 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100