Replace shared redis-exporter VMPodScrape with per-app scrapes
Per review: drop the cross-namespace label-selector approach. Each app now carries its own VMPodScrape next to its redis/valkey manifests, selecting on the deployment's existing pod labels (mirroring the arrstack exportarr pattern), so no opt-in monitoring.unkin.net/redis-exporter label is needed. - Remove the monitoring.unkin.net/redis-exporter pod label from the artifactapi/authentik/litellm redis and gitea/netbox valkey deployments - Delete apps/base/observability/vmpodscrape-redis.yaml - Add a local-namespace VMPodScrape (port metrics, path /metrics) to artifactapi, authentik, litellm (app=redis), gitea (app=gitea-valkey), netbox (app=netbox-valkey), and jellyfin (valkey-operator node labels)
This commit is contained in:
@@ -18,4 +18,5 @@ resources:
|
|||||||
- ui-hpa.yaml
|
- ui-hpa.yaml
|
||||||
- vaultauth.yaml
|
- vaultauth.yaml
|
||||||
- vaultstaticsecret.yaml
|
- vaultstaticsecret.yaml
|
||||||
|
- vmpodscrape.yaml
|
||||||
- vpa.yaml
|
- vpa.yaml
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ spec:
|
|||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app: redis
|
app: redis
|
||||||
monitoring.unkin.net/redis-exporter: "true"
|
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: redis
|
- name: redis
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
# Scrape the redis_exporter sidecar (:9121) on the redis pod. Picked up by the
|
||||||
|
# observability VMAgent (selectAllByDefault). Pod-level rather than
|
||||||
|
# VMServiceScrape because the redis Service doesn't expose the metrics port.
|
||||||
|
apiVersion: operator.victoriametrics.com/v1beta1
|
||||||
|
kind: VMPodScrape
|
||||||
|
metadata:
|
||||||
|
name: redis-exporter
|
||||||
|
namespace: artifactapi
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: redis
|
||||||
|
podMetricsEndpoints:
|
||||||
|
- port: metrics
|
||||||
|
path: /metrics
|
||||||
@@ -18,4 +18,5 @@ resources:
|
|||||||
- redis-service.yaml
|
- redis-service.yaml
|
||||||
- vaultauth.yaml
|
- vaultauth.yaml
|
||||||
- vaultstaticsecret.yaml
|
- vaultstaticsecret.yaml
|
||||||
|
- vmpodscrape.yaml
|
||||||
- vpa.yaml
|
- vpa.yaml
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ spec:
|
|||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app: redis
|
app: redis
|
||||||
monitoring.unkin.net/redis-exporter: "true"
|
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: redis
|
- name: redis
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
# Scrape the redis_exporter sidecar (:9121) on the redis pod. Picked up by the
|
||||||
|
# observability VMAgent (selectAllByDefault). Pod-level rather than
|
||||||
|
# VMServiceScrape because the redis Service doesn't expose the metrics port.
|
||||||
|
apiVersion: operator.victoriametrics.com/v1beta1
|
||||||
|
kind: VMPodScrape
|
||||||
|
metadata:
|
||||||
|
name: redis-exporter
|
||||||
|
namespace: authentik
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: redis
|
||||||
|
podMetricsEndpoints:
|
||||||
|
- port: metrics
|
||||||
|
path: /metrics
|
||||||
@@ -10,6 +10,7 @@ resources:
|
|||||||
- valkey-deployment.yaml
|
- valkey-deployment.yaml
|
||||||
- valkey-pvc.yaml
|
- valkey-pvc.yaml
|
||||||
- valkey-service.yaml
|
- valkey-service.yaml
|
||||||
|
- vmpodscrape.yaml
|
||||||
- vaultauth.yaml
|
- vaultauth.yaml
|
||||||
- vaultstaticsecret.yaml
|
- vaultstaticsecret.yaml
|
||||||
- gateway.yaml
|
- gateway.yaml
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ spec:
|
|||||||
app: gitea-valkey
|
app: gitea-valkey
|
||||||
app.kubernetes.io/name: gitea
|
app.kubernetes.io/name: gitea
|
||||||
app.kubernetes.io/component: valkey
|
app.kubernetes.io/component: valkey
|
||||||
monitoring.unkin.net/redis-exporter: "true"
|
|
||||||
spec:
|
spec:
|
||||||
securityContext:
|
securityContext:
|
||||||
fsGroup: 999
|
fsGroup: 999
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
# Scrape the redis_exporter sidecar (:9121) on the gitea-valkey pod. Picked up
|
||||||
|
# by the observability VMAgent (selectAllByDefault). Pod-level rather than
|
||||||
|
# VMServiceScrape because the valkey Service doesn't expose the metrics port.
|
||||||
|
apiVersion: operator.victoriametrics.com/v1beta1
|
||||||
|
kind: VMPodScrape
|
||||||
|
metadata:
|
||||||
|
name: valkey-exporter
|
||||||
|
namespace: gitea
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: gitea-valkey
|
||||||
|
podMetricsEndpoints:
|
||||||
|
- port: metrics
|
||||||
|
path: /metrics
|
||||||
@@ -21,5 +21,6 @@ resources:
|
|||||||
- pdb.yaml
|
- pdb.yaml
|
||||||
- service.yaml
|
- service.yaml
|
||||||
- valkey.yaml
|
- valkey.yaml
|
||||||
|
- vmpodscrape.yaml
|
||||||
- gateway.yaml
|
- gateway.yaml
|
||||||
- httproute.yaml
|
- httproute.yaml
|
||||||
|
|||||||
@@ -28,9 +28,8 @@ spec:
|
|||||||
# redis_exporter sidecar (:9121, port name `metrics`) on every ValkeyNode pod;
|
# redis_exporter sidecar (:9121, port name `metrics`) on every ValkeyNode pod;
|
||||||
# the operator manages a dedicated _exporter ACL user for it. Image overridden
|
# the operator manages a dedicated _exporter ACL user for it. Image overridden
|
||||||
# from the operator default (bare dockerhub oliver006/redis_exporter:v1.80.0)
|
# from the operator default (bare dockerhub oliver006/redis_exporter:v1.80.0)
|
||||||
# to the artifactapi-proxied pin. Scraped by the valkey-operator VMPodScrape in
|
# to the artifactapi-proxied pin. Scraped by the valkey-exporter VMPodScrape
|
||||||
# apps/base/observability (operator pods get fixed labels only, so they need
|
# in vmpodscrape.yaml alongside this file.
|
||||||
# their own selector rather than monitoring.unkin.net/redis-exporter).
|
|
||||||
exporter:
|
exporter:
|
||||||
enabled: true
|
enabled: true
|
||||||
image: artifactapi.k8s.syd1.au.unkin.net/dockerhub/oliver006/redis_exporter:v1.89.0
|
image: artifactapi.k8s.syd1.au.unkin.net/dockerhub/oliver006/redis_exporter:v1.89.0
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
# Scrape the operator-injected redis_exporter sidecar (:9121, port name
|
||||||
|
# `metrics`) on the jellyfin-valkey ValkeyNode pods. The valkey-operator gives
|
||||||
|
# its pods fixed labels only (no pod-label passthrough on the ValkeyCluster CR),
|
||||||
|
# so select on the operator-managed labels. Picked up by the observability
|
||||||
|
# VMAgent (selectAllByDefault).
|
||||||
|
apiVersion: operator.victoriametrics.com/v1beta1
|
||||||
|
kind: VMPodScrape
|
||||||
|
metadata:
|
||||||
|
name: valkey-exporter
|
||||||
|
namespace: jellyfin
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app.kubernetes.io/managed-by: valkey-operator
|
||||||
|
app.kubernetes.io/component: valkey-node
|
||||||
|
podMetricsEndpoints:
|
||||||
|
- port: metrics
|
||||||
|
path: /metrics
|
||||||
@@ -16,6 +16,7 @@ resources:
|
|||||||
- services.yaml
|
- services.yaml
|
||||||
- vaultauth.yaml
|
- vaultauth.yaml
|
||||||
- vaultstaticsecret.yaml
|
- vaultstaticsecret.yaml
|
||||||
|
- vmpodscrape.yaml
|
||||||
- vpa.yaml
|
- vpa.yaml
|
||||||
|
|
||||||
configMapGenerator:
|
configMapGenerator:
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ spec:
|
|||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app: redis
|
app: redis
|
||||||
monitoring.unkin.net/redis-exporter: "true"
|
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: redis
|
- name: redis
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
# Scrape the redis_exporter sidecar (:9121) on the redis pod. Picked up by the
|
||||||
|
# observability VMAgent (selectAllByDefault). Pod-level rather than
|
||||||
|
# VMServiceScrape because the redis Service doesn't expose the metrics port.
|
||||||
|
apiVersion: operator.victoriametrics.com/v1beta1
|
||||||
|
kind: VMPodScrape
|
||||||
|
metadata:
|
||||||
|
name: redis-exporter
|
||||||
|
namespace: litellm
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: redis
|
||||||
|
podMetricsEndpoints:
|
||||||
|
- port: metrics
|
||||||
|
path: /metrics
|
||||||
@@ -10,6 +10,7 @@ resources:
|
|||||||
- valkey-deployment.yaml
|
- valkey-deployment.yaml
|
||||||
- valkey-pvc.yaml
|
- valkey-pvc.yaml
|
||||||
- valkey-service.yaml
|
- valkey-service.yaml
|
||||||
|
- vmpodscrape.yaml
|
||||||
- vaultauth.yaml
|
- vaultauth.yaml
|
||||||
- vaultstaticsecret.yaml
|
- vaultstaticsecret.yaml
|
||||||
- gateway.yaml
|
- gateway.yaml
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ spec:
|
|||||||
app: netbox-valkey
|
app: netbox-valkey
|
||||||
app.kubernetes.io/name: netbox
|
app.kubernetes.io/name: netbox
|
||||||
app.kubernetes.io/component: valkey
|
app.kubernetes.io/component: valkey
|
||||||
monitoring.unkin.net/redis-exporter: "true"
|
|
||||||
spec:
|
spec:
|
||||||
securityContext:
|
securityContext:
|
||||||
fsGroup: 999
|
fsGroup: 999
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
# Scrape the redis_exporter sidecar (:9121) on the netbox-valkey pod. Picked up
|
||||||
|
# by the observability VMAgent (selectAllByDefault). Pod-level rather than
|
||||||
|
# VMServiceScrape because the valkey Service doesn't expose the metrics port.
|
||||||
|
apiVersion: operator.victoriametrics.com/v1beta1
|
||||||
|
kind: VMPodScrape
|
||||||
|
metadata:
|
||||||
|
name: valkey-exporter
|
||||||
|
namespace: netbox
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: netbox-valkey
|
||||||
|
podMetricsEndpoints:
|
||||||
|
- port: metrics
|
||||||
|
path: /metrics
|
||||||
@@ -9,5 +9,4 @@ resources:
|
|||||||
- gateway.yaml
|
- gateway.yaml
|
||||||
- httproute.yaml
|
- httproute.yaml
|
||||||
- vmpodscrape-cnpg.yaml
|
- vmpodscrape-cnpg.yaml
|
||||||
- vmpodscrape-redis.yaml
|
|
||||||
- vmpodscrape-traefik.yaml
|
- vmpodscrape-traefik.yaml
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
---
|
|
||||||
# Scrape metrics (:9121) from every redis/valkey pod carrying a redis_exporter
|
|
||||||
# sidecar in any namespace. Raw redis/valkey Deployments opt in via the
|
|
||||||
# monitoring.unkin.net/redis-exporter pod label. Picked up by the observability
|
|
||||||
# VMAgent (selectAllByDefault).
|
|
||||||
apiVersion: operator.victoriametrics.com/v1beta1
|
|
||||||
kind: VMPodScrape
|
|
||||||
metadata:
|
|
||||||
name: redis-exporters
|
|
||||||
namespace: observability
|
|
||||||
spec:
|
|
||||||
namespaceSelector:
|
|
||||||
any: true
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
monitoring.unkin.net/redis-exporter: "true"
|
|
||||||
podMetricsEndpoints:
|
|
||||||
- port: metrics
|
|
||||||
path: /metrics
|
|
||||||
---
|
|
||||||
# valkey-operator-managed ValkeyCluster pods (e.g. jellyfin-valkey) get fixed
|
|
||||||
# operator labels only -- the ValkeyCluster CR has no pod-label passthrough, so
|
|
||||||
# they cannot carry monitoring.unkin.net/redis-exporter and need their own
|
|
||||||
# selector. The operator's exporter sidecar also listens on :9121 with a port
|
|
||||||
# named `metrics`.
|
|
||||||
apiVersion: operator.victoriametrics.com/v1beta1
|
|
||||||
kind: VMPodScrape
|
|
||||||
metadata:
|
|
||||||
name: valkey-operator-clusters
|
|
||||||
namespace: observability
|
|
||||||
spec:
|
|
||||||
namespaceSelector:
|
|
||||||
any: true
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app.kubernetes.io/managed-by: valkey-operator
|
|
||||||
app.kubernetes.io/component: valkey-node
|
|
||||||
podMetricsEndpoints:
|
|
||||||
- port: metrics
|
|
||||||
path: /metrics
|
|
||||||
Reference in New Issue
Block a user