From bf5da46002581412726c08136702a707a07ce8b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kr=C3=B3likowski?= Date: Tue, 30 Dec 2025 23:39:06 +0100 Subject: [PATCH 01/24] feat: mounting secrets as volumes --- CHANGELOG.md | 6 ++++++ chart/Chart.yaml | 2 +- chart/templates/deployment.yaml | 5 +++++ chart/values.yaml | 3 +++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d33708..7141bb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [2.8.0] - 2025-12-30 + +### Added + +- Ability to mount secrets as volumes. I'ts handy when you need to mount encrypted config file + ## [2.7.0] - 2025-12-14 ### Added diff --git a/chart/Chart.yaml b/chart/Chart.yaml index f610da7..62e3d70 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.7.0 +version: 2.8.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index bd3675d..708ff80 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -115,6 +115,11 @@ spec: configMap: name: {{ .Values.configMap.name }} {{- end }} + {{- if .Values.volumes.secret }} + - name: {{ .Release.Name }}-secret-volume + secret: + {{- toYaml . | nindent 12 }} + {{- end }} - name: {{ .Release.Name }}-volume {{- if .Values.volumes.type.nfs }} nfs: diff --git a/chart/values.yaml b/chart/values.yaml index feafaad..730ce32 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -26,6 +26,9 @@ ingress: tls: {} volumes: enabled: false + secret: + secretName: "" + items: {} mountPath: [] ownership: "" type: From 340f03977ccda77284717c823a0e5cfc6d8b74fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kr=C3=B3likowski?= Date: Wed, 31 Dec 2025 07:06:11 +0100 Subject: [PATCH 02/24] refactor: change secret volume configuration --- chart/templates/deployment.yaml | 6 +++++- chart/values.yaml | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index 708ff80..13cba2d 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -42,6 +42,10 @@ spec: - name: {{ .Values.configMap.name }} mountPath: {{ .Values.configMap.mountPath }} {{- end }} + {{- if .Values.volumes.secret }} + - name: {{ .Release.Name }}-secret-volume + mountPath: {{ .Values.volumes.secret.MountPath }} + {{- end }} {{- range .Values.volumes.mountPath }} {{- $dirmap := regexSplit ":" . -1 }} {{- $sub_path := slice $dirmap 0 1 | first }} @@ -118,7 +122,7 @@ spec: {{- if .Values.volumes.secret }} - name: {{ .Release.Name }}-secret-volume secret: - {{- toYaml . | nindent 12 }} + secretName: {{ .Values.volumes.secret.secretName }} {{- end }} - name: {{ .Release.Name }}-volume {{- if .Values.volumes.type.nfs }} diff --git a/chart/values.yaml b/chart/values.yaml index 730ce32..2074386 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -28,7 +28,7 @@ volumes: enabled: false secret: secretName: "" - items: {} + mountPath: "" mountPath: [] ownership: "" type: From 954b1c97c758fd563fd12721fdbb7f94a89538fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kr=C3=B3likowski?= Date: Wed, 31 Dec 2025 10:57:25 +0100 Subject: [PATCH 03/24] fix: changing condition --- chart/templates/initWebsiteDir.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/chart/templates/initWebsiteDir.yaml b/chart/templates/initWebsiteDir.yaml index f58db22..acf1a62 100644 --- a/chart/templates/initWebsiteDir.yaml +++ b/chart/templates/initWebsiteDir.yaml @@ -1,4 +1,3 @@ -{{- if .Values.volumes.enabled -}} {{- if .Values.volumes.type.nfs -}} {{- $dirs_to_create := "" -}} apiVersion: batch/v1 @@ -62,4 +61,3 @@ spec: server: {{ .Values.volumes.type.nfs.server }} path: {{ .Values.volumes.type.nfs.path }} {{- end }} -{{- end }} From 20988d457fb0344c8ad91bfac54d4f47f5c65f31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kr=C3=B3likowski?= Date: Wed, 31 Dec 2025 11:00:51 +0100 Subject: [PATCH 04/24] fix: first letter lowercase --- chart/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index 13cba2d..fab9f63 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -44,7 +44,7 @@ spec: {{- end }} {{- if .Values.volumes.secret }} - name: {{ .Release.Name }}-secret-volume - mountPath: {{ .Values.volumes.secret.MountPath }} + mountPath: {{ .Values.volumes.secret.mountPath }} {{- end }} {{- range .Values.volumes.mountPath }} {{- $dirmap := regexSplit ":" . -1 }} From 59d8b6b0d2b7e80f9736a116366bc6a8142370b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kr=C3=B3likowski?= Date: Wed, 31 Dec 2025 11:27:28 +0100 Subject: [PATCH 05/24] fix: remove default nfs configuration --- chart/values.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/chart/values.yaml b/chart/values.yaml index 2074386..6c9e1a2 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -31,12 +31,8 @@ volumes: mountPath: "" mountPath: [] ownership: "" - type: - nfs: - server: lab-storage.lan - path: /volume1/storagelab deployNotifications: enabled: false image: "" nodeSelector: {} -configMap: {} \ No newline at end of file +configMap: {} From 03e57217433450fc8a553a865f4f8e7e4e6cdf1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kr=C3=B3likowski?= Date: Wed, 31 Dec 2025 12:19:37 +0100 Subject: [PATCH 06/24] feat: adding option to mount single file --- chart/templates/deployment.yaml | 3 +++ chart/values.yaml | 1 + 2 files changed, 4 insertions(+) diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index fab9f63..6f6ec00 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -45,6 +45,9 @@ spec: {{- if .Values.volumes.secret }} - name: {{ .Release.Name }}-secret-volume mountPath: {{ .Values.volumes.secret.mountPath }} + {{- if .Values.volumes.secret.subPath }} + subPath: {{ .Values.volumes.secret.subPath }} + {{- end}} {{- end }} {{- range .Values.volumes.mountPath }} {{- $dirmap := regexSplit ":" . -1 }} diff --git a/chart/values.yaml b/chart/values.yaml index 6c9e1a2..e51489a 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -29,6 +29,7 @@ volumes: secret: secretName: "" mountPath: "" + subPath: "" mountPath: [] ownership: "" deployNotifications: From 8397237de3677ede292431f58beaee4dee11faef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kr=C3=B3likowski?= Date: Tue, 24 Feb 2026 21:04:21 +0100 Subject: [PATCH 07/24] refactor: renaming configmap volume name for consistency --- chart/templates/deployment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index 6f6ec00..97d6b53 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -39,7 +39,7 @@ spec: {{- if .Values.volumes.enabled }} volumeMounts: {{- if .Values.configMap }} - - name: {{ .Values.configMap.name }} + - name: {{ .Values.configMap.name }}-config-volume mountPath: {{ .Values.configMap.mountPath }} {{- end }} {{- if .Values.volumes.secret }} @@ -118,7 +118,7 @@ spec: {{- end}} volumes: {{- if .Values.configMap }} - - name: {{ .Values.configMap.name }} + - name: {{ .Values.configMap.name }}-config-volume configMap: name: {{ .Values.configMap.name }} {{- end }} From bcd5ee12e0ae3a128c181ab448effb2ccb915f87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kr=C3=B3likowski?= Date: Tue, 24 Feb 2026 21:51:36 +0100 Subject: [PATCH 08/24] feat: maintaining mounting configMap and secret --- chart/templates/deployment.yaml | 15 +++++++-------- chart/values.yaml | 6 ++---- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index 97d6b53..8fdded7 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -38,12 +38,12 @@ spec: {{- end }} {{- if .Values.volumes.enabled }} volumeMounts: - {{- if .Values.configMap }} - - name: {{ .Values.configMap.name }}-config-volume - mountPath: {{ .Values.configMap.mountPath }} + {{- if .Values.volumes.configMap }} + - name: {{ .Values.volumes.configMap.name }} + mountPath: {{ .Values.volumes.configMap.mountPath }} {{- end }} {{- if .Values.volumes.secret }} - - name: {{ .Release.Name }}-secret-volume + - name: {{ .Values.volumes.secret.secretName }} mountPath: {{ .Values.volumes.secret.mountPath }} {{- if .Values.volumes.secret.subPath }} subPath: {{ .Values.volumes.secret.subPath }} @@ -117,13 +117,12 @@ spec: fsGroup: {{ $gid | default 0 }} {{- end}} volumes: - {{- if .Values.configMap }} - - name: {{ .Values.configMap.name }}-config-volume + {{- if .Values.volumes.configMap }} + - name: {{ .Values.volumes.configMap.name }} configMap: - name: {{ .Values.configMap.name }} + name: {{ .Values.volumes.configMap.name }} {{- end }} {{- if .Values.volumes.secret }} - - name: {{ .Release.Name }}-secret-volume secret: secretName: {{ .Values.volumes.secret.secretName }} {{- end }} diff --git a/chart/values.yaml b/chart/values.yaml index e51489a..1df8eb2 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -26,10 +26,8 @@ ingress: tls: {} volumes: enabled: false - secret: - secretName: "" - mountPath: "" - subPath: "" + secret: {} + configMap: {} mountPath: [] ownership: "" deployNotifications: From 0889d82caaa46583aca183054a009f63cfae6598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kr=C3=B3likowski?= Date: Tue, 24 Feb 2026 22:48:28 +0100 Subject: [PATCH 09/24] fix: secret object fields update --- chart/values.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chart/values.yaml b/chart/values.yaml index 1df8eb2..5da3cc5 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -26,7 +26,10 @@ ingress: tls: {} volumes: enabled: false - secret: {} + secret: + secretName: "" + mountPath: "" + subPath: "" configMap: {} mountPath: [] ownership: "" From 3315f78c9027dce1db80d812a6264709f7f9cd35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kr=C3=B3likowski?= Date: Wed, 25 Feb 2026 07:21:55 +0100 Subject: [PATCH 10/24] fix: mounts handling --- chart/templates/deployment.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index 8fdded7..66caf2c 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -49,6 +49,7 @@ spec: subPath: {{ .Values.volumes.secret.subPath }} {{- end}} {{- end }} + {{- if .Values.volumes.type.nfs }} {{- range .Values.volumes.mountPath }} {{- $dirmap := regexSplit ":" . -1 }} {{- $sub_path := slice $dirmap 0 1 | first }} @@ -63,6 +64,7 @@ spec: subPath: {{ $sub_path }} {{- end }} {{- end }} + {{- end }} {{- end}} env: {{- with .Values.env }} @@ -126,8 +128,8 @@ spec: secret: secretName: {{ .Values.volumes.secret.secretName }} {{- end }} + {{- if .Values.volumes.type.nfs }} - name: {{ .Release.Name }}-volume - {{- if .Values.volumes.type.nfs }} nfs: server: {{ .Values.volumes.type.nfs.server }} {{- if .Values.volumes.rootDir }} @@ -136,8 +138,5 @@ spec: path: {{ .Values.volumes.type.nfs.path }}/{{ .Release.Name }} {{- end }} readOnly: false - {{- else }} - persistentVolumeClaim: - claimName: {{ .Release.Name }}-pvc {{- end }} {{- end }} From abd908423818fe7cbea83c44e003577d4f0f9a66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kr=C3=B3likowski?= Date: Wed, 25 Feb 2026 17:12:06 +0100 Subject: [PATCH 11/24] removing initdir hook --- chart/templates/initWebsiteDir.yaml | 63 ----------------------------- 1 file changed, 63 deletions(-) delete mode 100644 chart/templates/initWebsiteDir.yaml diff --git a/chart/templates/initWebsiteDir.yaml b/chart/templates/initWebsiteDir.yaml deleted file mode 100644 index acf1a62..0000000 --- a/chart/templates/initWebsiteDir.yaml +++ /dev/null @@ -1,63 +0,0 @@ -{{- if .Values.volumes.type.nfs -}} -{{- $dirs_to_create := "" -}} -apiVersion: batch/v1 -kind: Job -metadata: - name: "{{ .Release.Name }}-init-websitedir" - labels: - app.kubernetes.io/managed-by: {{ .Release.Service | quote }} - app.kubernetes.io/instance: {{ .Release.Name | quote }} - app.kubernetes.io/version: {{ .Chart.AppVersion }} - helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - annotations: - "helm.sh/hook": pre-install - "helm.sh/hook-weight": "0" - "helm.sh/hook-delete-policy": hook-succeeded -spec: - template: - metadata: - name: "{{ .Release.Name }}" - labels: - app.kubernetes.io/managed-by: {{ .Release.Service | quote }} - app.kubernetes.io/instance: {{ .Release.Name | quote }} - helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - spec: - restartPolicy: Never - containers: - - name: "{{ .Release.Name }}-init-websitedir" - image: gitea.angrybits.pl/kkrolikowski/toolbox:0.0.1 - env: - - name: WEBSITE_DIRS - {{- range .Values.volumes.mountPath }} - {{- $dirmap := regexSplit ":" . -1 -}} - {{- $dir := slice $dirmap 0 1 | first -}} - {{- if $.Values.volumes.rootDir -}} - {{- $dirs_to_create = printf "%s %s/%s/%s" $dirs_to_create "/storage" $.Values.volumes.rootDir $dir }} - {{- else }} - {{- $dirs_to_create = printf "%s %s/%s/%s" $dirs_to_create "/storage" $.Release.Name $dir }} - {{- end }} - {{- end }} - value: {{ $dirs_to_create }} - - name: OWNERSHIP - value: {{ .Values.volumes.ownership | default "root:root" }} - volumeMounts: - - mountPath: /storage - name: {{ .Release.Name }}-volume - command: ["/bin/sh"] - args: - - -c - - >- - if [! -d $(WEBSITE_DIRS) ]; then - mkdir -p $(WEBSITE_DIRS); - chown -R $(OWNERSHIP) $(WEBSITE_DIRS); - fi - nodeSelector: - {{- with .Values.nodeSelector }} - {{- toYaml . | nindent 8 }} - {{- end }} - volumes: - - name: {{ .Release.Name }}-volume - nfs: - server: {{ .Values.volumes.type.nfs.server }} - path: {{ .Values.volumes.type.nfs.path }} -{{- end }} From 8419b30203830326a964572eb785aedc4d29633c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kr=C3=B3likowski?= Date: Wed, 25 Feb 2026 17:13:53 +0100 Subject: [PATCH 12/24] removing dbhelper hook --- chart/templates/mysqlDBhelper.yaml | 57 ------------------------------ 1 file changed, 57 deletions(-) delete mode 100644 chart/templates/mysqlDBhelper.yaml diff --git a/chart/templates/mysqlDBhelper.yaml b/chart/templates/mysqlDBhelper.yaml deleted file mode 100644 index d5354e9..0000000 --- a/chart/templates/mysqlDBhelper.yaml +++ /dev/null @@ -1,57 +0,0 @@ -{{- if .Values.database.enabled -}} -apiVersion: batch/v1 -kind: Job -metadata: - name: "{{ .Release.Name }}-dbserver" - labels: - app.kubernetes.io/managed-by: {{ .Release.Service | quote }} - app.kubernetes.io/instance: {{ .Release.Name | quote }} - app.kubernetes.io/version: {{ .Chart.AppVersion }} - helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - annotations: - "helm.sh/hook": pre-install - "helm.sh/hook-weight": "-4" - "helm.sh/hook-delete-policy": hook-succeeded -spec: - template: - metadata: - name: "{{ .Release.Name }}" - labels: - app.kubernetes.io/managed-by: {{ .Release.Service | quote }} - app.kubernetes.io/instance: {{ .Release.Name | quote }} - helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - spec: - restartPolicy: Never - containers: - - name: mysqldb-helper - image: gitea.angrybits.pl/kkrolikowski/mysql-initdb:0.0.1 - env: - - name: DB_ADMIN_LOGIN - valueFrom: - secretKeyRef: - name: dbadmin - key: login - - name: DB_ADMIN_PASS - valueFrom: - secretKeyRef: - name: dbadmin - key: password - - name: APPDB_NAME - value: {{ .Release.Name | trimSuffix "-www" }} - - name: APPDB_LOGIN - valueFrom: - secretKeyRef: - name: {{ .Release.Name }}-db - key: login - - name: APPDB_PASS - valueFrom: - secretKeyRef: - name: {{ .Release.Name }}-db - key: password - - name: DB_HOST - value: srv-db2.lan - nodeSelector: - {{- with .Values.nodeSelector }} - {{- toYaml . | nindent 8 }} - {{- end }} -{{- end }} \ No newline at end of file From 2bc9ecd6f4e7466c6eae288b75089ede78e7e75f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kr=C3=B3likowski?= Date: Wed, 25 Feb 2026 17:14:06 +0100 Subject: [PATCH 13/24] bumping version --- CHANGELOG.md | 2 +- chart/Chart.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7141bb8..a971133 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [2.8.0] - 2025-12-30 +## [3.0.0] - 2025-12-30 ### Added diff --git a/chart/Chart.yaml b/chart/Chart.yaml index 62e3d70..1ca8bcc 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.8.0 +version: 3.0.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. From 746b756cfb5cd90804508eeb523bd0f153892cbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kr=C3=B3likowski?= Date: Wed, 25 Feb 2026 17:17:03 +0100 Subject: [PATCH 14/24] obsolete database option --- chart/values.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/chart/values.yaml b/chart/values.yaml index 5da3cc5..316b493 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -1,8 +1,6 @@ replicaCount: 1 autoscaling: enabled: false -database: - enabled: false image: imagePolicy: false repository: "" From 84e02b9564bb83de36d7f3f5abc8002c3757a526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kr=C3=B3likowski?= Date: Wed, 25 Feb 2026 18:00:50 +0100 Subject: [PATCH 15/24] adding secrets and configmaps support --- chart/templates/deployment.yaml | 67 +++++++++++++++++---------------- chart/test_values.yaml | 19 +++++++--- chart/values.yaml | 7 ---- 3 files changed, 48 insertions(+), 45 deletions(-) diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index 66caf2c..b7b1dfd 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -38,9 +38,15 @@ spec: {{- end }} {{- if .Values.volumes.enabled }} volumeMounts: - {{- if .Values.volumes.configMap }} - - name: {{ .Values.volumes.configMap.name }} - mountPath: {{ .Values.volumes.configMap.mountPath }} + {{- if .Values.volumes.nfs }} + {{- range .Values.volumes.nfs.mountPath }} + {{- $dirmap := regexSplit ":" . -1 }} + {{- $sub_path := slice $dirmap 0 1 | first }} + {{- $mount := slice $dirmap 1 | last }} + - mountPath: {{ $mount | default "/var/www" }} + name: {{ $.Release.Name }}-volume + subPath: {{ $sub_path }} + {{- end }} {{- end }} {{- if .Values.volumes.secret }} - name: {{ .Values.volumes.secret.secretName }} @@ -49,21 +55,12 @@ spec: subPath: {{ .Values.volumes.secret.subPath }} {{- end}} {{- end }} - {{- if .Values.volumes.type.nfs }} - {{- range .Values.volumes.mountPath }} - {{- $dirmap := regexSplit ":" . -1 }} - {{- $sub_path := slice $dirmap 0 1 | first }} - {{- $mount := slice $dirmap 1 | last }} - {{- if $.Values.volumes.type.pvc }} - {{- $path := $mount }} - - mountPath: {{ $mount | default "/var/www" }} - name: {{ $.Release.Name }}-volume - {{- else }} - - mountPath: {{ $mount | default "/var/www" }} - name: {{ $.Release.Name }}-volume - subPath: {{ $sub_path }} - {{- end }} - {{- end }} + {{- if .Values.volumes.configmap }} + - name: {{ .Values.volumes.configmap.configMap }} + mountPath: {{ .Values.volumes.configmap.mountPath }} + {{- if .Values.volumes.configmap.subPath }} + subPath: {{ .Values.volumes.configmap.subPath }} + {{- end}} {{- end }} {{- end}} env: @@ -119,24 +116,30 @@ spec: fsGroup: {{ $gid | default 0 }} {{- end}} volumes: - {{- if .Values.volumes.configMap }} + {{- if .Values.volumes.configMap }} - name: {{ .Values.volumes.configMap.name }} configMap: name: {{ .Values.volumes.configMap.name }} - {{- end }} - {{- if .Values.volumes.secret }} - secret: - secretName: {{ .Values.volumes.secret.secretName }} - {{- end }} - {{- if .Values.volumes.type.nfs }} + {{- end }} + {{- if .Values.volumes.nfs }} - name: {{ .Release.Name }}-volume nfs: - server: {{ .Values.volumes.type.nfs.server }} - {{- if .Values.volumes.rootDir }} - path: {{ .Values.volumes.type.nfs.path }}/{{ .Values.volumes.rootDir }} - {{- else }} - path: {{ .Values.volumes.type.nfs.path }}/{{ .Release.Name }} - {{- end }} + server: {{ .Values.volumes.nfs.server }} + {{- if .Values.volumes.rootDir }} + path: {{ .Values.volumes.nfs.path }}/{{ .Values.volumes.rootDir }} + {{- else }} + path: {{ .Values.volumes.nfs.path }}/{{ .Release.Name }} + {{- end }} readOnly: false - {{- end }} + {{- end }} + {{- if .Values.volumes.secret }} + - name: {{ .Values.volumes.secret.secretName }} + secret: + secretName: {{ .Values.volumes.secret.secretName }} + {{- end }} + {{- if .Values.volumes.configmap }} + - name: {{ .Values.volumes.configmap.configMap }} + configMap: + name: {{ .Values.volumes.ssecret.configMap }} + {{- end }} {{- end }} diff --git a/chart/test_values.yaml b/chart/test_values.yaml index 0474745..bafcb81 100644 --- a/chart/test_values.yaml +++ b/chart/test_values.yaml @@ -19,12 +19,19 @@ resources: # enabled: false volumes: enabled: true - mountPath: - - storage:/storage - type: - nfs: - server: lab-storage.lan - path: /volume1/storagelab + nfs: + server: lab-storage.lan + path: /volume1/storagelab + mountPath: + - storage:/ + secret: + secretName: app-secret + mountPath: /app/secret.json + subPath: secret.json + configmap: + configMap: app-config + mountPath: /conf/config.ini + subPath: config.ini nodeSelector: kubernetes.io/arch: arm64 services: diff --git a/chart/values.yaml b/chart/values.yaml index 316b493..6db5b24 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -24,13 +24,6 @@ ingress: tls: {} volumes: enabled: false - secret: - secretName: "" - mountPath: "" - subPath: "" - configMap: {} - mountPath: [] - ownership: "" deployNotifications: enabled: false image: "" From ac04e950e30faf2ff33c3d8cfc40584fdb84ed45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kr=C3=B3likowski?= Date: Wed, 25 Feb 2026 18:04:59 +0100 Subject: [PATCH 16/24] manual service name --- chart/templates/service.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chart/templates/service.yaml b/chart/templates/service.yaml index abd3f66..9d98632 100644 --- a/chart/templates/service.yaml +++ b/chart/templates/service.yaml @@ -5,7 +5,7 @@ apiVersion: v1 kind: Service metadata: - name: "{{ $.Release.Name }}-{{ .name }}" + name: "{{ .name }}" namespace: {{ $.Release.Namespace }} spec: type: {{ .type }} From 28ec01d0591bf7f5ab94e6dc92fa79d6f0da5f40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kr=C3=B3likowski?= Date: Wed, 25 Feb 2026 18:13:38 +0100 Subject: [PATCH 17/24] removing notifications hook changed default volumes value --- chart/templates/mattermost-notify.yaml | 48 -------------------------- chart/values.yaml | 6 +--- 2 files changed, 1 insertion(+), 53 deletions(-) delete mode 100644 chart/templates/mattermost-notify.yaml diff --git a/chart/templates/mattermost-notify.yaml b/chart/templates/mattermost-notify.yaml deleted file mode 100644 index f164b7a..0000000 --- a/chart/templates/mattermost-notify.yaml +++ /dev/null @@ -1,48 +0,0 @@ -{{- if .Values.deployNotifications.enabled }} -apiVersion: batch/v1 -kind: Job -metadata: - name: "{{ .Release.Name }}-mattermost" - labels: - app.kubernetes.io/managed-by: {{ .Release.Service | quote }} - app.kubernetes.io/instance: {{ .Release.Name | quote }} - app.kubernetes.io/version: {{ .Chart.AppVersion }} - helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - annotations: - "helm.sh/hook": post-install,post-upgrade - "helm.sh/hook-weight": "0" - "helm.sh/hook-delete-policy": hook-succeeded -spec: - template: - metadata: - name: "{{ .Release.Name }}" - labels: - app.kubernetes.io/managed-by: {{ .Release.Service | quote }} - app.kubernetes.io/instance: {{ .Release.Name | quote }} - helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - spec: - restartPolicy: Never - containers: - - name: "{{ .Release.Name }}-mattermost" - image: {{ .Values.deployNotifications.image }} - env: - - name: MM_USERNAME - valueFrom: - secretKeyRef: - name: cron-secrets - key: mm_usernane - - name: MM_BOT_TOKEN - valueFrom: - secretKeyRef: - name: cron-secrets - key: mm_bot_token - - name: MM_CHAT - valueFrom: - secretKeyRef: - name: cron-secrets - key: mm_chat - - name: APP_NAME - value: {{ .Release.Name }} - - name: APP_VERSION - value: {{ .Values.image.tag }} -{{- end }} \ No newline at end of file diff --git a/chart/values.yaml b/chart/values.yaml index 6db5b24..5250f50 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -22,10 +22,6 @@ ingress: enabled: false hosts: [] tls: {} -volumes: - enabled: false -deployNotifications: - enabled: false - image: "" +volumes: {} nodeSelector: {} configMap: {} From f2590a39b64060e9551ecfd356b4320ad776f20d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kr=C3=B3likowski?= Date: Wed, 25 Feb 2026 18:25:46 +0100 Subject: [PATCH 18/24] removing values.volume.type key --- chart/templates/deployment.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index b7b1dfd..af21432 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -108,13 +108,6 @@ spec: {{- with .Values.nodeSelector }} {{- toYaml . | nindent 8 }} {{- end }} - {{- if .Values.volumes.enabled }} - {{- if .Values.volumes.type.pvc }} - {{- $ownership := regexSplit ":" .Values.volumes.ownership -1 }} - {{- $gid := slice $ownership 0 1 | first }} - securityContext: - fsGroup: {{ $gid | default 0 }} - {{- end}} volumes: {{- if .Values.volumes.configMap }} - name: {{ .Values.volumes.configMap.name }} @@ -142,4 +135,3 @@ spec: configMap: name: {{ .Values.volumes.ssecret.configMap }} {{- end }} - {{- end }} From 728bc3b2edf6be85a7321d6daccaa349056551bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kr=C3=B3likowski?= Date: Wed, 25 Feb 2026 18:35:36 +0100 Subject: [PATCH 19/24] removing volume.type obsolete option --- chart/templates/deployment.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index af21432..01188ef 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -36,7 +36,6 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} {{- end }} - {{- if .Values.volumes.enabled }} volumeMounts: {{- if .Values.volumes.nfs }} {{- range .Values.volumes.nfs.mountPath }} @@ -62,7 +61,6 @@ spec: subPath: {{ .Values.volumes.configmap.subPath }} {{- end}} {{- end }} - {{- end}} env: {{- with .Values.env }} {{- toYaml . | nindent 12 }} From 5e3d8c3548d6939112515bf10c51367545f4718f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kr=C3=B3likowski?= Date: Wed, 25 Feb 2026 19:18:58 +0100 Subject: [PATCH 20/24] fixing configmap configuration --- chart/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index 01188ef..b682407 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -131,5 +131,5 @@ spec: {{- if .Values.volumes.configmap }} - name: {{ .Values.volumes.configmap.configMap }} configMap: - name: {{ .Values.volumes.ssecret.configMap }} + name: {{ .Values.volumes.configmap.configMap }} {{- end }} From 0c1cfe3d2d72034a5c66bddd53e14e50a50edc57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kr=C3=B3likowski?= Date: Wed, 25 Feb 2026 19:24:09 +0100 Subject: [PATCH 21/24] obsolete database option --- chart/templates/dbsecrets.yaml | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 chart/templates/dbsecrets.yaml diff --git a/chart/templates/dbsecrets.yaml b/chart/templates/dbsecrets.yaml deleted file mode 100644 index 5b97170..0000000 --- a/chart/templates/dbsecrets.yaml +++ /dev/null @@ -1,14 +0,0 @@ -{{- if .Values.database.enabled -}} -apiVersion: v1 -kind: Secret -metadata: - name: {{.Release.Name }}-db - annotations: - "helm.sh/hook": pre-install - "helm.sh/hook-weight": "-5" - "helm.sh/hook-delete-policy": before-hook-creation -type: Opaque -data: - login: {{ .Release.Name | trimSuffix "-www" | b64enc | quote }} - password: {{ randAlphaNum 32 | b64enc | quote }} -{{- end }} \ No newline at end of file From b68ac50e137a342598f35f540bfbbbedcfa3c10a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kr=C3=B3likowski?= Date: Wed, 25 Feb 2026 19:37:19 +0100 Subject: [PATCH 22/24] changing ingress config --- chart/templates/ingress.yaml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/chart/templates/ingress.yaml b/chart/templates/ingress.yaml index 620da3a..184c3a6 100644 --- a/chart/templates/ingress.yaml +++ b/chart/templates/ingress.yaml @@ -1,12 +1,10 @@ {{- if .Values.ingress.enabled -}} {{- range .Values.ingress.hosts }} -{{- $subdomain := .name | splitList "." | first -}} -{{- $ReleaseName := printf "%s-%s" $.Release.Name $subdomain -}} --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: {{ $ReleaseName }} + name: {{ $.Release.Name}} namespace: {{ $.Release.Namespace }} {{- if $.Values.ingress.ssl }} annotations: @@ -23,12 +21,12 @@ spec: pathType: Prefix backend: service: - name: {{ $ReleaseName }} + name: {{ $.Release.Name }} port: number: {{ .servicePort }} {{- if $.Values.ingress.ssl }} tls: - - secretName: {{ $ReleaseName }}-tls + - secretName: {{ $.Release.Name }}-tls hosts: - {{ .name }} {{- end }} From 42ad5fcc5cc68a238147cbdcf5a39163e67af385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kr=C3=B3likowski?= Date: Wed, 25 Feb 2026 20:15:09 +0100 Subject: [PATCH 23/24] adding enable servicelinks option --- chart/templates/deployment.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index b682407..bf73daf 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -15,6 +15,9 @@ spec: labels: {{- include "basic.selectorLabels" . | nindent 8 }} spec: + {{- if .Values.enableServiceLinks }} + enableServiceLinks: {{ .Values.enableServiceLinks }} + {{- end }} containers: - name: {{ .Release.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" From b24f020b344891fd354deffe16666fdf27a6e42f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kr=C3=B3likowski?= Date: Wed, 25 Feb 2026 20:23:24 +0100 Subject: [PATCH 24/24] set enableServiceLinks to false by default --- chart/templates/deployment.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index bf73daf..e87af5d 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -15,9 +15,7 @@ spec: labels: {{- include "basic.selectorLabels" . | nindent 8 }} spec: - {{- if .Values.enableServiceLinks }} - enableServiceLinks: {{ .Values.enableServiceLinks }} - {{- end }} + enableServiceLinks: false containers: - name: {{ .Release.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"