From d56348f9a65dad5cc375eb091f1b80570eab8ff7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Thu, 17 Aug 2023 11:57:32 +0300 Subject: [PATCH] wildduck: Add Prometheus exporter --- wildduck/wildduck-exporter.yaml | 68 +++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 wildduck/wildduck-exporter.yaml diff --git a/wildduck/wildduck-exporter.yaml b/wildduck/wildduck-exporter.yaml new file mode 100644 index 0000000..bd2f1b5 --- /dev/null +++ b/wildduck/wildduck-exporter.yaml @@ -0,0 +1,68 @@ +--- +apiVersion: codemowers.cloud/v1beta1 +kind: SecretClaim +metadata: + name: wildduck-exporter + namespace: wildduck +spec: + size: 32 + mapping: + - key: PROMETHEUS_BEARER_TOKEN + value: "%(plaintext)s" +--- +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + name: wildduck-exporter + namespace: wildduck +spec: + podMetricsEndpoints: + - bearerTokenSecret: + key: PROMETHEUS_BEARER_TOKEN + name: wildduck-exporter + targetPort: 3001 + selector: + matchLabels: + app: wildduck-exporter +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: wildduck-exporter + namespace: wildduck +spec: + replicas: 1 + selector: + matchLabels: + app: wildduck-exporter + template: + metadata: + labels: + app: wildduck-exporter + spec: + containers: + - name: webmail + image: harbor.k-space.ee/k-space/wildduck-exporter + securityContext: + readOnlyRootFilesystem: true + runAsNonRoot: true + runAsUser: 65534 + command: + - /wildduck_exporter.py + args: + - info + - accounting + ports: + - containerPort: 3001 + name: metrics + env: + - name: MONGODB_HOST + valueFrom: + secretKeyRef: + name: wildduck + key: MONGO_URI + - name: PROMETHEUS_BEARER_TOKEN + valueFrom: + secretKeyRef: + name: wildduck-exporter + key: PROMETHEUS_BEARER_TOKEN