diff --git a/deploy/helm/pagetron/templates/prometheus.configmap.yaml b/deploy/helm/pagetron/templates/prometheus.configmap.yaml index 443749d..fedaad1 100644 --- a/deploy/helm/pagetron/templates/prometheus.configmap.yaml +++ b/deploy/helm/pagetron/templates/prometheus.configmap.yaml @@ -27,6 +27,15 @@ data: - targets: - "localhost:9090" + {{- if .reloader.enabled }} + - job_name: reloader + metrics_path: "/metrics" + scheme: "http" + static_configs: + - targets: + - "localhost:9533" + {{- end }} + # blackbox operational metrics - job_name: "blackbox_exporter" static_configs: diff --git a/deploy/helm/pagetron/templates/prometheus.deployment.yaml b/deploy/helm/pagetron/templates/prometheus.deployment.yaml index 48670ac..043e4f3 100644 --- a/deploy/helm/pagetron/templates/prometheus.deployment.yaml +++ b/deploy/helm/pagetron/templates/prometheus.deployment.yaml @@ -40,6 +40,7 @@ spec: - --storage.tsdb.path=/prometheus - --web.console.libraries=/usr/share/prometheus/console_libraries - --web.console.templates=/usr/share/prometheus/consoles + - --web.enable-lifecycle - --web.enable-admin-api - --storage.tsdb.retention.time=10y - --storage.tsdb.retention.size=10GB @@ -60,14 +61,44 @@ spec: port: http volumeMounts: - - mountPath: /etc/prometheus - name: config - - mountPath: /prometheus - name: data + - name: config + mountPath: /etc/prometheus + - name: data + mountPath: /prometheus resources: {{- toYaml .resources | nindent 12 }} + {{- if .reloader.enabled }} + - name: reloader + + image: {{ .reloader.image.repository }}:{{ .reloader.image.tag }} + imagePullPolicy: IfNotPresent + + command: + - "/configmap-reload" + args: + - -volume-dir=/config + - -webhook-method=POST + - -webhook-status-code=200 + - -webhook-url=http://127.0.0.1:9090/-/reload + - -webhook-retries=1 + + volumeMounts: + - name: config + mountPath: /config + - name: data + mountPath: /prometheus + + resources: + limits: + cpu: 100m + memory: 64Mi + requests: + cpu: 50m + memory: 64Mi + {{- end }} + volumes: - name: config configMap: diff --git a/deploy/helm/pagetron/values.yaml b/deploy/helm/pagetron/values.yaml index d01128e..9363c8d 100644 --- a/deploy/helm/pagetron/values.yaml +++ b/deploy/helm/pagetron/values.yaml @@ -66,6 +66,12 @@ prometheus: cpu: 50m memory: 256Mi + reloader: + enabled: true + image: + repository: ghcr.io/jimmidyson/configmap-reload + tag: v0.12.0 + nodeSelector: {} tolerations: []