mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 08:57:04 +02:00
feat(common): Release common v4.1.0 (#416)
This commit is contained in:
parent
f3660654f4
commit
db552e2dee
52 changed files with 705 additions and 129 deletions
|
@ -9,6 +9,19 @@
|
|||
($serviceMonitorObject.annotations | default dict)
|
||||
(include "bjw-s.common.lib.metadata.globalAnnotations" $rootContext | fromYaml)
|
||||
-}}
|
||||
{{ $service := dict -}}
|
||||
{{ $serviceName := "" -}}
|
||||
{{ if $serviceMonitorObject.serviceName -}}
|
||||
{{ $serviceName = tpl $serviceMonitorObject.serviceName $rootContext -}}
|
||||
{{ else if not (empty (dig "service" "name" nil $serviceMonitorObject)) -}}
|
||||
{{ $serviceName = tpl $serviceMonitorObject.service.name $rootContext -}}
|
||||
{{ else if not (empty (dig "service" "identifier" nil $serviceMonitorObject)) -}}
|
||||
{{ $service = (include "bjw-s.common.lib.service.getByIdentifier" (dict "rootContext" $rootContext "id" $serviceMonitorObject.service.identifier) | fromYaml ) -}}
|
||||
{{ if not $service -}}
|
||||
{{fail (printf "No enabled Service found with this identifier. (serviceMonitor: '%s', identifier: '%s')" $serviceMonitorObject.identifier $serviceMonitorObject.service.identifier)}}
|
||||
{{ end -}}
|
||||
{{ $serviceName = $service.name -}}
|
||||
{{ end -}}
|
||||
---
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
|
@ -37,7 +50,7 @@ spec:
|
|||
{{- tpl ($serviceMonitorObject.selector | toYaml) $rootContext | nindent 4}}
|
||||
{{- else }}
|
||||
matchLabels:
|
||||
app.kubernetes.io/service: {{ tpl $serviceMonitorObject.serviceName $rootContext }}
|
||||
app.kubernetes.io/service: {{ $serviceName }}
|
||||
{{- include "bjw-s.common.lib.metadata.selectorLabels" $rootContext | nindent 6 }}
|
||||
{{- end }}
|
||||
endpoints: {{- tpl (toYaml $serviceMonitorObject.endpoints) $rootContext | nindent 4 }}
|
||||
|
|
|
@ -47,7 +47,15 @@ spec:
|
|||
matchLabels:
|
||||
app.kubernetes.io/controller: {{ $statefulsetObject.identifier }}
|
||||
{{- include "bjw-s.common.lib.metadata.selectorLabels" $rootContext | nindent 6 }}
|
||||
serviceName: {{ include "bjw-s.common.lib.chart.names.fullname" $rootContext }}
|
||||
{{- $serviceName := include "bjw-s.common.lib.chart.names.fullname" $rootContext }}
|
||||
{{- with (dig "statefulset" "serviceName" nil $statefulsetObject) }}
|
||||
{{- if kindIs "map" . }}
|
||||
{{- $serviceName = (include "bjw-s.common.lib.service.getByIdentifier" (dict "rootContext" $rootContext "id" .identifier) | fromYaml ).name }}
|
||||
{{- else }}
|
||||
{{- $serviceName = tpl . $rootContext }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
serviceName: {{ $serviceName }}
|
||||
{{- with (dig "statefulset" "persistentVolumeClaimRetentionPolicy" nil $statefulsetObject) }}
|
||||
persistentVolumeClaimRetentionPolicy: {{ . | toYaml | nindent 4 }}
|
||||
{{- end }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue