72 lines
2.0 KiB
YAML
72 lines
2.0 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"
|
|
bstein.dev/restarted-at: "2026-01-06T00:00:00Z"
|
|
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: POSTMARK_SENDING_LIMIT
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: postmark-exporter
|
|
key: sending-limit
|
|
optional: true
|
|
- name: POSTMARK_SENDING_LIMIT_WINDOW
|
|
value: "30d"
|
|
- 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
|