Skip to content

Commit

Permalink
fix: reload config (#36)
Browse files Browse the repository at this point in the history
* feat: add reloader

* style: improve manifest a little

* fix: reload webhook proto
  • Loading branch information
agrrh authored Dec 13, 2023
1 parent 9958b20 commit 9fdaaf9
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 4 deletions.
9 changes: 9 additions & 0 deletions deploy/helm/pagetron/templates/prometheus.configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
39 changes: 35 additions & 4 deletions deploy/helm/pagetron/templates/prometheus.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions deploy/helm/pagetron/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: []

Expand Down

0 comments on commit 9fdaaf9

Please sign in to comment.