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

82 lines
1.9 KiB
YAML
Raw Permalink Normal View History

2024-05-04 15:30:57 +00:00
{{- if .Values.config.raw }}
2024-04-29 14:27:33 +00:00
---
apiVersion: v1
2024-05-04 15:30:57 +00:00
kind: Secret
2024-04-29 14:27:33 +00:00
metadata:
2024-05-04 15:30:57 +00:00
name: {{ include "helmrelease.fullname" . }}-raw-config
2024-04-29 14:27:33 +00:00
labels:
{{- include "helmrelease.labels" $ | nindent 4 }}
2024-05-04 15:30:57 +00:00
stringData:
2024-04-29 14:27:33 +00:00
config: |-
2024-05-04 15:30:57 +00:00
{{- .Values.config.raw | toYaml | nindent 6 }}
2024-04-29 14:27:33 +00:00
{{- end }}
2024-05-04 15:30:57 +00:00
{{- if .Values.config.pretty }}
2024-04-29 14:27:33 +00:00
---
apiVersion: v1
kind: Secret
metadata:
name: {{ include "helmrelease.fullname" . }}-config
labels:
{{- include "helmrelease.labels" $ | nindent 4 }}
2024-05-04 15:30:57 +00:00
stringData:
{{- range .Values.config.pretty }}
2024-05-12 09:39:01 +00:00
{{ .key }}: {{ .value | quote }}
2024-05-04 15:30:57 +00:00
{{- end }}
2024-04-29 14:27:33 +00:00
{{- end }}
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
name: {{ include "helmrelease.fullname" . }}-repo
labels:
{{- include "helmrelease.labels" $ | nindent 4 }}
spec:
interval: 5m
2024-05-04 15:30:57 +00:00
url: {{ .Values.helm.repo.url }}
type: {{ .Values.helm.repo.type }}
2024-04-29 14:27:33 +00:00
---
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
2024-05-04 15:30:57 +00:00
{{- if or .Values.config.pretty .Values.config.raw }}
2024-04-29 14:27:33 +00:00
valuesFrom:
2024-05-04 15:30:57 +00:00
{{- if .Values.config.raw }}
- kind: Secret
name: {{ include "helmrelease.fullname" . }}-raw-config
2024-04-29 14:27:33 +00:00
valuesKey: config
{{- end }}
2024-05-04 15:30:57 +00:00
{{- range .Values.config.pretty }}
2024-04-29 14:27:33 +00:00
- kind: Secret
2024-05-04 15:30:57 +00:00
name: {{ include "helmrelease.fullname" $ }}-config
valuesKey: {{ .key }}
targetPath: {{ .path }}
2024-04-29 14:27:33 +00:00
{{- end }}
{{- end }}