diff --git a/apps/base/arrstack/radarr/deployment.yaml b/apps/base/arrstack/radarr/deployment.yaml index 39e8dbb..b64079b 100644 --- a/apps/base/arrstack/radarr/deployment.yaml +++ b/apps/base/arrstack/radarr/deployment.yaml @@ -182,6 +182,51 @@ spec: - name: vault-ca mountPath: /etc/ssl/vault-ca readOnly: true + # exportarr sidecar: polls the local replica's API and exposes Prometheus + # metrics on :9708 (scraped by the radarr-exportarr VMPodScrape). + - name: exportarr + image: artifactapi.k8s.syd1.au.unkin.net/ghcr/onedr0p/exportarr:v2.3.0 + imagePullPolicy: IfNotPresent + args: + - radarr + env: + - name: PORT + value: "9708" + # URL includes the /radarr UrlBase (Radarr__Server__UrlBase). + - name: URL + value: http://localhost:7878/radarr + - name: APIKEY + valueFrom: + secretKeyRef: + name: radarr-apikey + key: apitoken + ports: + - name: metrics + containerPort: 9708 + protocol: TCP + livenessProbe: + httpGet: + path: /healthz + port: metrics + initialDelaySeconds: 15 + periodSeconds: 30 + timeoutSeconds: 5 + failureThreshold: 3 + readinessProbe: + httpGet: + path: /healthz + port: metrics + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 3 + resources: + requests: + cpu: 25m + memory: 32Mi + limits: + cpu: 100m + memory: 128Mi volumes: - name: config emptyDir: {} diff --git a/apps/base/arrstack/radarr/kustomization.yaml b/apps/base/arrstack/radarr/kustomization.yaml index faed5e3..8789f80 100644 --- a/apps/base/arrstack/radarr/kustomization.yaml +++ b/apps/base/arrstack/radarr/kustomization.yaml @@ -9,3 +9,4 @@ resources: - service.yaml - gateway.yaml - httproute.yaml + - vmpodscrape.yaml diff --git a/apps/base/arrstack/radarr/vmpodscrape.yaml b/apps/base/arrstack/radarr/vmpodscrape.yaml new file mode 100644 index 0000000..097f571 --- /dev/null +++ b/apps/base/arrstack/radarr/vmpodscrape.yaml @@ -0,0 +1,16 @@ +--- +# Scrape the exportarr sidecar (:9708) on every radarr pod. Picked up by the +# observability VMAgent (selectAllByDefault). Pod-level rather than +# VMServiceScrape because the radarr Service doesn't expose the metrics port. +apiVersion: operator.victoriametrics.com/v1beta1 +kind: VMPodScrape +metadata: + name: radarr-exportarr + namespace: arrstack +spec: + selector: + matchLabels: + app: radarr + podMetricsEndpoints: + - port: metrics + path: /metrics diff --git a/apps/base/arrstack/sonarr/deployment.yaml b/apps/base/arrstack/sonarr/deployment.yaml index 05d0551..f2331bc 100644 --- a/apps/base/arrstack/sonarr/deployment.yaml +++ b/apps/base/arrstack/sonarr/deployment.yaml @@ -184,6 +184,51 @@ spec: - name: vault-ca mountPath: /etc/ssl/vault-ca readOnly: true + # exportarr sidecar: polls the local replica's API and exposes Prometheus + # metrics on :9707 (scraped by the sonarr-exportarr VMPodScrape). + - name: exportarr + image: artifactapi.k8s.syd1.au.unkin.net/ghcr/onedr0p/exportarr:v2.3.0 + imagePullPolicy: IfNotPresent + args: + - sonarr + env: + - name: PORT + value: "9707" + # URL includes the /sonarr UrlBase (Sonarr__Server__UrlBase). + - name: URL + value: http://localhost:8989/sonarr + - name: APIKEY + valueFrom: + secretKeyRef: + name: sonarr-apikey + key: apitoken + ports: + - name: metrics + containerPort: 9707 + protocol: TCP + livenessProbe: + httpGet: + path: /healthz + port: metrics + initialDelaySeconds: 15 + periodSeconds: 30 + timeoutSeconds: 5 + failureThreshold: 3 + readinessProbe: + httpGet: + path: /healthz + port: metrics + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 3 + resources: + requests: + cpu: 25m + memory: 32Mi + limits: + cpu: 100m + memory: 128Mi volumes: - name: config emptyDir: {} diff --git a/apps/base/arrstack/sonarr/kustomization.yaml b/apps/base/arrstack/sonarr/kustomization.yaml index faed5e3..8789f80 100644 --- a/apps/base/arrstack/sonarr/kustomization.yaml +++ b/apps/base/arrstack/sonarr/kustomization.yaml @@ -9,3 +9,4 @@ resources: - service.yaml - gateway.yaml - httproute.yaml + - vmpodscrape.yaml diff --git a/apps/base/arrstack/sonarr/vmpodscrape.yaml b/apps/base/arrstack/sonarr/vmpodscrape.yaml new file mode 100644 index 0000000..82f61f4 --- /dev/null +++ b/apps/base/arrstack/sonarr/vmpodscrape.yaml @@ -0,0 +1,16 @@ +--- +# Scrape the exportarr sidecar (:9707) on every sonarr pod. Picked up by the +# observability VMAgent (selectAllByDefault). Pod-level rather than +# VMServiceScrape because the sonarr Service doesn't expose the metrics port. +apiVersion: operator.victoriametrics.com/v1beta1 +kind: VMPodScrape +metadata: + name: sonarr-exportarr + namespace: arrstack +spec: + selector: + matchLabels: + app: sonarr + podMetricsEndpoints: + - port: metrics + path: /metrics