softplayer-helmfile/charts/helmrelease/templates/helmrelease.yaml

82 lines
1.9 KiB
YAML

{{- if .Values.config.raw }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ include "helmrelease.fullname" . }}-raw-config
labels:
{{- include "helmrelease.labels" $ | nindent 4 }}
stringData:
config: |-
{{- .Values.config.raw | toYaml | nindent 6 }}
{{- end }}
{{- if .Values.config.pretty }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ include "helmrelease.fullname" . }}-config
labels:
{{- include "helmrelease.labels" $ | nindent 4 }}
stringData:
{{- range .Values.config.pretty }}
{{ .key }}: {{ .value | quote }}
{{- end }}
{{- end }}
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
name: {{ include "helmrelease.fullname" . }}-repo
labels:
{{- include "helmrelease.labels" $ | nindent 4 }}
spec:
interval: 5m
url: {{ .Values.helm.repo.url }}
type: {{ .Values.helm.repo.type }}
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: {{ include "helmrelease.fullname" . }}
labels:
{{- include "helmrelease.labels" $ | nindent 4 }}
spec:
interval: 10m
timeout: 5m
chart:
spec:
chart: {{ .Values.helm.chart.name }}
version: {{ .Values.helm.chart.version }}
sourceRef:
kind: HelmRepository
name: {{ include "helmrelease.fullname" . }}-repo
interval: 5m
releaseName: {{ .Values.helm.release }}
install:
remediation:
retries: 3
upgrade:
remediation:
retries: 3
test:
enable: true
driftDetection:
mode: enabled
{{- if or .Values.config.pretty .Values.config.raw }}
valuesFrom:
{{- if .Values.config.raw }}
- kind: Secret
name: {{ include "helmrelease.fullname" . }}-raw-config
valuesKey: config
{{- end }}
{{- range .Values.config.pretty }}
- kind: Secret
name: {{ include "helmrelease.fullname" $ }}-config
valuesKey: {{ .key }}
targetPath: {{ .path }}
{{- end }}
{{- end }}