Skip to content

Commit

Permalink
Merge pull request #11 from Starttoaster/chart
Browse files Browse the repository at this point in the history
Fix servicemonitor in helm chart
  • Loading branch information
Starttoaster authored Mar 9, 2024
2 parents 70c4a40 + 3654437 commit 72b8717
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion chart/proxmox-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
version: 0.1.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
12 changes: 11 additions & 1 deletion chart/proxmox-exporter/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ metadata:
name: {{ include "proxmox-exporter.fullname" . }}
labels:
{{- include "proxmox-exporter.labels" . | nindent 4 }}
{{- if .Values.serviceMonitor.additionalLabels }}
{{- toYaml .Values.serviceMonitor.additionalLabels | nindent 4 }}
{{- end }}
{{- if .Values.serviceMonitor.annotations }}
annotations: {{ toYaml .Values.serviceMonitor.annotations | nindent 4 }}
{{- end }}
spec:
endpoints:
- interval: 30s
Expand All @@ -15,9 +21,13 @@ spec:
{{- if .Values.serviceMonitor.metricRelabelings }}
metricRelabelings: {{ toYaml .Values.serviceMonitor.metricRelabelings | nindent 8 }}
{{- end }}
{{- if .Values.serviceMonitor.namespaceSelector }}
namespaceSelector: {{ toYaml .Values.serviceMonitor.namespaceSelector | nindent 4 }}
{{- else }}
namespaceSelector:
matchNames:
- {{ include "proxmox-exporter.namespace" . }}
- {{ .Release.Namespace }}
{{- end }}
{{- if .Values.serviceMonitor.jobLabel }}
jobLabel: {{ .Values.serviceMonitor.jobLabel | quote }}
{{- end }}
Expand Down
5 changes: 5 additions & 0 deletions chart/proxmox-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ serviceMonitor:
## jobLabel: "app.kubernetes.io/name"
additionalLabels: {}
annotations: {}
namespaceSelector: {}
## Default: scrape .Release.Namespace or namespaceOverride only
## To scrape all, use the following:
## namespaceSelector:
## any: true
targetLabels: []
relabelings: []
metricRelabelings: []
Expand Down

0 comments on commit 72b8717

Please sign in to comment.