Repository navigation
Conversation
Every WorkspaceType gets its own multicluster manager inside this process,
but the manager options leave Metrics unset, so controller-runtime falls back
to its default ":8080" for each of them. The first manager claims that port
and every subsequent one fails to start:
Failed to run multicluster manager ctrlkey=root:account
error=failed to start metrics server: failed to create listener: listen tcp :8080: bind: address already in use
The affected WorkspaceType is then never initialized (its InitTargets are
ignored) until the pod happens to restart with that target already known.
Only the main manager serves metrics (--metrics-address, 127.0.0.1:8085 by
default), and metrics of the per-WorkspaceType managers are not exposed
anywhere anyway, so disable the metrics server for them.
Fixes kcp-dev#26
Signed-off-by: Nikita Aboltin <aboltin.nikita@rwb.ru>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @2mind. Thanks for your PR. I'm waiting for a kcp-dev member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/kind bug |
Summary
targetcontroller.createMulticlusterManager()creates one multicluster manager per WorkspaceType, but never setsMetricsin the manager options. controller-runtime then falls back to its default bind address (:8080) for every one of them: the first manager claims the port, and each subsequent manager fails to start:The WorkspaceType of the failed manager is then never initialized — its InitTargets are ignored until the pod restarts and happens to start with that target already known.
This disables the metrics server for the per-WorkspaceType managers (
BindAddress: "0"). Only the main manager is supposed to serve metrics (--metrics-address,127.0.0.1:8085by default), and the secondary managers' metrics are not scraped from anywhere."Disable" rather than "one port per WorkspaceType" because the number of WorkspaceTypes is unbounded, while only a single metrics endpoint is actually served; if per-WorkspaceType metrics are ever wanted, they should be registered with a WorkspaceType label in the main registry instead.
Verification
go build ./...,go vet ./internal/...,CGO_ENABLED=1 go test -tags unit ./...— pass.What Type of PR Is This?
/kind bug
Related Issue(s)
Fixes #26
Release Notes