diff options
| author | 2024-06-09 19:08:35 +0100 | |
|---|---|---|
| committer | 2024-06-10 17:36:08 +0200 | |
| commit | e976d40a223182137d9fed78fb1b19d405975f6c (patch) | |
| tree | d8e817bab0fe8810a71393135c3b726b253ee7b0 /kubernetes/namespaces | |
| parent | Add 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.yaml | 25 | 
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 | 
