Skip to content

Commit

Permalink
Add sidecar container to reload Prometheus config on change
Browse files Browse the repository at this point in the history
  • Loading branch information
jb3 committed Jun 10, 2024
1 parent 77a7a36 commit 4001934
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions kubernetes/namespaces/monitoring/prometheus/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -59,3 +80,7 @@ spec:
- name: prometheus-alerts
configMap:
name: prometheus-alert-rules
- name: reloader-hook
configMap:
name: prometheus-reloader-script
defaultMode: 0777

0 comments on commit 4001934

Please sign in to comment.