Skip to content

Commit

Permalink
fix(helm): correct helm relabeling #38
Browse files Browse the repository at this point in the history
  • Loading branch information
jplanckeel authored Aug 9, 2022
2 parents e1f7861 + c031818 commit ae0e7a8
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/helm-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
run : helm lint ./helm/prescaling-exporter

- name: Helm3 template
run : helm template prescaling-exporter helm/prescaling-exporter
run : helm template prescaling-exporter helm/prescaling-exporter -f helm/test-values.yml
4 changes: 2 additions & 2 deletions helm/prescaling-exporter/templates/monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
{{- end }}
{{- if .Values.prometheus.monitor.relabelings }}
relabelings:
{{ toYaml .Values.prometheus.monitor.relabelings | indent 8 }}
{{ toYaml .Values.prometheus.monitor.relabelings | nindent 8 }}
{{- end }}
{{- end -}}

Expand All @@ -41,7 +41,7 @@ spec:
scrapeTimeout: {{ .Values.victoriametrics.monitor.scrapeTimeout }}
{{- if .Values.victoriametrics.monitor.relabelings }}
relabelConfigs:
{{ toYaml .Values.victoriametrics.monitor.relabelings | indent 8 }}
{{ toYaml .Values.victoriametrics.monitor.relabelings | nindent 8 }}
{{- end }}
jobLabel: {{ template "prescaling-exporter.fullname" . }}
selector:
Expand Down
47 changes: 47 additions & 0 deletions helm/test-values.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Configure Prometheus service scrapping with
prometheus:
monitor:
enabled: false
additionalLabels: {}
relabelings:
- action: replace
regex: (.*)
replacement: $1
sourceLabels:
- __meta_kubernetes_pod_name
targetLabel: kubernetes_pod_name
- action: replace
regex: (.*)
replacement: $1
sourceLabels:
- __meta_kubernetes_namespace
targetLabel: kubernetes_namespace
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- action: labeldrop
regex: (endpoint|pod_template_hash|pod_template_generation|controller_revision_hash)
scrapeTimeout: 10s

# Configure VictoiraMetrics service scrapping with
victoriametrics:
monitor:
enabled: true
additionalLabels: {}
relabelings:
- action: replace
regex: (.*)
replacement: $1
sourceLabels:
- __meta_kubernetes_pod_name
targetLabel: kubernetes_pod_name
- action: replace
regex: (.*)
replacement: $1
sourceLabels:
- __meta_kubernetes_namespace
targetLabel: kubernetes_namespace
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- action: labeldrop
regex: (endpoint|pod_template_hash|pod_template_generation|controller_revision_hash)
scrapeTimeout: 10s

0 comments on commit ae0e7a8

Please sign in to comment.