Update helmrelease

This commit is contained in:
Nikolai Rodionov 2024-05-04 17:30:57 +02:00
parent 726f2e98cf
commit c520ba3a5c
Signed by: allanger
GPG Key ID: 0AA46A90E25592AD
2 changed files with 28 additions and 24 deletions

View File

@ -1,17 +1,17 @@
{{- if .Values.config.plain }}
{{- if .Values.config.raw }}
---
apiVersion: v1
kind: ConfigMap
kind: Secret
metadata:
name: {{ include "helmrelease.fullname" . }}-config
name: {{ include "helmrelease.fullname" . }}-raw-config
labels:
{{- include "helmrelease.labels" $ | nindent 4 }}
data:
stringData:
config: |-
{{- .Values.config | toYaml | nindent 6 }}
{{- .Values.config.raw | toYaml | nindent 6 }}
{{- end }}
{{- if .Values.config.sensitive }}
{{- if .Values.config.pretty }}
---
apiVersion: v1
kind: Secret
@ -19,9 +19,10 @@ metadata:
name: {{ include "helmrelease.fullname" . }}-config
labels:
{{- include "helmrelease.labels" $ | nindent 4 }}
stringData:
config: |-
{{- .Values.config | toYaml | nindent 6 }}
stringData:
{{- range .Values.config.pretty }}
{{ .key }}: {{ .value }}
{{- end }}
{{- end }}
---
@ -33,7 +34,8 @@ metadata:
{{- include "helmrelease.labels" $ | nindent 4 }}
spec:
interval: 5m
url: {{ .Values.helm.repo }}
url: {{ .Values.helm.repo.url }}
type: {{ .Values.helm.repo.type }}
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
@ -63,16 +65,17 @@ spec:
enable: true
driftDetection:
mode: enabled
{{- if or .Values.config.plain .Values.config.sensitive }}
{{- if or .Values.config.pretty .Values.config.raw }}
valuesFrom:
{{- if .Values.config.plain }}
- kind: ConfigMap
name: {{ include "helmrelease.fullname" . }}-config
{{- if .Values.config.raw }}
- kind: Secret
name: {{ include "helmrelease.fullname" . }}-raw-config
valuesKey: config
{{- end }}
{{- if .Values.config.sensitive }}
{{- range .Values.config.pretty }}
- kind: Secret
name: {{ include "helmrelease.fullname" . }}-config
valuesKey: config
name: {{ include "helmrelease.fullname" $ }}-config
valuesKey: {{ .key }}
targetPath: {{ .path }}
{{- end }}
{{- end }}

View File

@ -3,11 +3,12 @@ helm:
chart:
name: test
version: test
repo: test
repo:
url: test
type: oci
config:
plain:
test: test
test2: test2
secret:
test: test
test2: test2
pretty:
- key: encryption_method
path: env.environment.data.METHOD
value: test
raw: ""