Skip to content

Commit

Permalink
refactor: use podmonitor
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrokiefer committed Mar 19, 2021
1 parent f18675e commit b9d4f90
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion charts/conntrack-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v1
appVersion: 0.6.0
description: Prometheus Conntrack Exporter
name: conntrack-exporter
version: 0.1.5
version: 0.1.6
32 changes: 32 additions & 0 deletions charts/conntrack-exporter/templates/podmonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{- if .Values.podMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ template "conntrack-exporter.fullname" . }}
namespace: {{ template "conntrack-exporter.namespace" . }}
labels:
{{ include "conntrack-exporter.labels" . | indent 4 }}
{{- if .Values.podMonitor.additionalLabels }}
{{ toYaml .Values.podMonitor.additionalLabels | indent 4 }}
{{- end }}
spec:
selector:
matchLabels:
app: {{ template "conntrack-exporter.name" . }}
podMetricsEndpoints:
- port: http-metrics
scheme: {{ $.Values.podMonitor.scheme }}
{{- if $.Values.podMonitor.bearerTokenFile }}
bearerTokenFile: {{ $.Values.podMonitor.bearerTokenFile }}
{{- end }}
{{- if $.Values.podMonitor.tlsConfig }}
tlsConfig: {{ toYaml $.Values.podMonitor.tlsConfig | nindent 8 }}
{{- end }}
{{- if .Values.podMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.podMonitor.scrapeTimeout }}
{{- end }}
{{- if .Values.podMonitor.relabelings }}
relabelings:
{{ toYaml .Values.podMonitor.relabelings | indent 8 }}
{{- end }}
{{- end }}
32 changes: 0 additions & 32 deletions charts/conntrack-exporter/templates/servicemonitor.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion charts/conntrack-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ serviceAccount:
# If not set and create is true, a name is generated using the fullname template
name: ""

serviceMonitor:
podMonitor:
enabled: true
additionalLabels: []

Expand Down

0 comments on commit b9d4f90

Please sign in to comment.