Skip to content

Commit bf5ac31

Browse files
authored
fix(viz): update admin port names (#15090)
**Problem** After #14111, prometheus does not correctly scrape the control plane pods due to a misconfigured regex. This is true for both the regular control plane components as well as the multicluster addon. **Solution** Update the regex for the `linkerd-controller` and `linkerd-multicluster-controller` jobs to keep any port that matches the pattern `*.admin$` instead of matching the entire string `admin`. This way, any port name that ends with or is just `admin` is matched. Additionally, any port that matches `linkerd-admin` is dropped to not scrape the control plane proxies twice. This change is in line with the handling in the `PodMonitors` for the control plane and multicluster addon. **Validation** Set up two clusters with multicluster link enabled. Roll out the new prometheus config and check that control plane metrics (not just the control plane proxies) are present. Fixes #14642 and #15089. Signed-off-by: Benedikt Kittinger <benedikt.kittinger@post.at>
1 parent 348d2b2 commit bf5ac31

5 files changed

Lines changed: 50 additions & 10 deletions

File tree

viz/charts/linkerd-viz/templates/prometheus.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ data:
6868
- source_labels:
6969
- __meta_kubernetes_pod_container_port_name
7070
action: keep
71-
regex: admin
71+
regex: .*admin$
72+
- source_labels:
73+
- __meta_kubernetes_pod_container_port_name
74+
action: drop
75+
regex: linkerd-admin
7276
- source_labels: [__meta_kubernetes_pod_container_name]
7377
action: replace
7478
target_label: component
@@ -81,7 +85,11 @@ data:
8185
- __meta_kubernetes_pod_label_component
8286
- __meta_kubernetes_pod_container_port_name
8387
action: keep
84-
regex: (linkerd-service-mirror|controller);admin$
88+
regex: (linkerd-service-mirror|controller);.*-admin$
89+
- source_labels:
90+
- __meta_kubernetes_pod_container_port_name
91+
action: drop
92+
regex: linkerd-admin
8593
- source_labels: [__meta_kubernetes_pod_container_name]
8694
action: replace
8795
target_label: component

viz/cmd/testdata/install_default.golden

Lines changed: 10 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

viz/cmd/testdata/install_default_overrides.golden

Lines changed: 10 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

viz/cmd/testdata/install_prometheus_loglevel_from_args.golden

Lines changed: 10 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

viz/cmd/testdata/install_proxy_resources.golden

Lines changed: 10 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)