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

79 lines
1.8 KiB
YAML

{{- if .Values.config.plain }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "helmrelease.fullname" . }}-config
labels:
{{- include "helmrelease.labels" $ | nindent 4 }}
data:
config: |-
{{- .Values.config | toYaml | nindent 6 }}
{{- end }}
{{- if .Values.config.sensitive }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ include "helmrelease.fullname" . }}-config
labels:
{{- include "helmrelease.labels" $ | nindent 4 }}
stringData:
config: |-
{{- .Values.config | toYaml | nindent 6 }}
{{- 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 }}
---
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.plain .Values.config.sensitive }}
valuesFrom:
{{- if .Values.config.plain }}
- kind: ConfigMap
name: {{ include "helmrelease.fullname" . }}-config
valuesKey: config
{{- end }}
{{- if .Values.config.sensitive }}
- kind: Secret
name: {{ include "helmrelease.fullname" . }}-config
valuesKey: config
{{- end }}
{{- end }}