aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/namespaces
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2024-06-09 19:08:35 +0100
committerGravatar jchristgit <[email protected]>2024-06-10 17:36:08 +0200
commite976d40a223182137d9fed78fb1b19d405975f6c (patch)
treed8e817bab0fe8810a71393135c3b726b253ee7b0 /kubernetes/namespaces
parentAdd reloader hook configmap to reload prometheus on change (diff)
Add sidecar container to reload Prometheus config on change
Diffstat (limited to 'kubernetes/namespaces')
-rw-r--r--kubernetes/namespaces/monitoring/prometheus/deployment.yaml25
1 files changed, 25 insertions, 0 deletions
diff --git a/kubernetes/namespaces/monitoring/prometheus/deployment.yaml b/kubernetes/namespaces/monitoring/prometheus/deployment.yaml
index 63176d4..3071636 100644
--- a/kubernetes/namespaces/monitoring/prometheus/deployment.yaml
+++ b/kubernetes/namespaces/monitoring/prometheus/deployment.yaml
@@ -44,6 +44,27 @@ spec:
mountPath: /etc/prometheus
- name: prometheus-alerts
mountPath: /opt/pydis/prometheus/alerts.d
+ - image: ghcr.io/owl-corp/inotify-base:latest
+ imagePullPolicy: Always
+ name: prometheus-reloader
+ securityContext:
+ readOnlyRootFilesystem: true
+ volumeMounts:
+ - name: prometheus-config
+ mountPath: /opt/monitor/prom-config
+ - name: prometheus-alerts
+ mountPath: /opt/monitor/prom-alerts
+ - name: reloader-hook
+ mountPath: /opt/pydis
+ env:
+ - name: INOTIFY_HOOK_SCRIPT
+ value: /opt/pydis/hook.sh
+ # When a ConfigMap volume updates we see a delete event for the old
+ # container timestamp
+ - name: INOTIFY_WATCH_EVENTS
+ value: delete
+ - name: INOTIFY_HOOK_DELAY
+ value: "5"
restartPolicy: Always
securityContext:
fsGroup: 2000
@@ -59,3 +80,7 @@ spec:
- name: prometheus-alerts
configMap:
name: prometheus-alert-rules
+ - name: reloader-hook
+ configMap:
+ name: prometheus-reloader-script
+ defaultMode: 0777