mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47:04 +02:00
- 🛑 BREAKING - Removed support for the openvpn and wireguard VPN types.
- Update container versions
- Added support for adding serviceMonitors to services.
- ConfigMap checksum logic now only looks at ConfigMap data
- Explicitly convert defaultMode to decimal notation in code-server addon.
30 lines
1.1 KiB
Smarty
30 lines
1.1 KiB
Smarty
{{- define "common.classes.serviceMonitor" -}}
|
|
{{- $values := dict -}}
|
|
{{- if hasKey . "ObjectValues" -}}
|
|
{{- with .ObjectValues.serviceMonitor -}}
|
|
{{- $values = . -}}
|
|
{{- end -}}
|
|
{{ end -}}
|
|
|
|
{{- $serviceMonitorName := include "common.names.fullname" . -}}
|
|
{{- if and (hasKey $values "nameOverride") $values.nameOverride -}}
|
|
{{- $serviceMonitorName = printf "%v-%v" $serviceMonitorName $values.nameOverride -}}
|
|
{{ end -}}
|
|
---
|
|
apiVersion: monitoring.coreos.com/v1
|
|
kind: ServiceMonitor
|
|
metadata:
|
|
name: {{ $serviceMonitorName }}
|
|
{{- with (merge ($values.labels | default dict) (include "common.labels" $ | fromYaml)) }}
|
|
labels: {{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
{{- with (merge ($values.annotations | default dict) (include "common.annotations" $ | fromYaml)) }}
|
|
annotations: {{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/service: {{ $values.serviceName }}
|
|
{{- include "common.labels.selectorLabels" . | nindent 6 }}
|
|
endpoints: {{- toYaml (required (printf "endpoints are required for serviceMonitor %v" $serviceMonitorName) $values.endpoints) | nindent 4 }}
|
|
{{- end }}
|