titan-iac/services/monitoring/postmark-exporter-deployment.yaml

64 lines
1.7 KiB
YAML

# services/monitoring/postmark-exporter-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: postmark-exporter
spec:
replicas: 1
selector:
matchLabels:
app: postmark-exporter
template:
metadata:
labels:
app: postmark-exporter
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8000"
prometheus.io/path: "/metrics"
spec:
containers:
- name: exporter
image: python:3.12-alpine
imagePullPolicy: IfNotPresent
command: ["/bin/sh", "-c"]
args:
- |
set -euo pipefail
pip install --no-cache-dir prometheus-client==0.22.1 requests==2.32.3
exec python /app/monitoring_postmark_exporter.py
env:
- name: POSTMARK_SERVER_TOKEN
valueFrom:
secretKeyRef:
name: postmark-exporter
key: relay-username
- name: POSTMARK_SERVER_TOKEN_FALLBACK
valueFrom:
secretKeyRef:
name: postmark-exporter
key: relay-password
- name: POLL_INTERVAL_SECONDS
value: "60"
- name: LISTEN_PORT
value: "8000"
ports:
- name: http
containerPort: 8000
volumeMounts:
- name: script
mountPath: /app
readOnly: true
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 250m
memory: 256Mi
volumes:
- name: script
configMap:
name: postmark-exporter-script