From 120a96e2878dbde9947044717792e1215b7a4176 Mon Sep 17 00:00:00 2001 From: Niklas Date: Thu, 9 Apr 2026 12:54:44 +0200 Subject: [PATCH 1/3] #81 Add backup labels --- CHANGELOG.md | 2 ++ k8s/helm/templates/_helpers.tpl | 5 +++++ k8s/helm/templates/initial-admin-password-secret.yaml | 1 + k8s/helm/templates/statefulset.yaml | 1 + 4 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46b87d7..9a73d7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added +- [#81] Added label `k8s.cloudogu.com/backup-scope` to include necessary k8s ressources in the backup for the ldap Helm-based component. ## [v2.6.10-6] - 2026-04-10 ### Fixed diff --git a/k8s/helm/templates/_helpers.tpl b/k8s/helm/templates/_helpers.tpl index 0c07510..9c9bcfa 100644 --- a/k8s/helm/templates/_helpers.tpl +++ b/k8s/helm/templates/_helpers.tpl @@ -26,6 +26,10 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} {{- end -}} +{{- define "ldap.backupLabels" -}} +k8s.cloudogu.com/backup-scope: ldap +{{- end }} + {{- define "ldap.kebab" -}} {{- /* Split each lower/digit + upper boundary (`([a-z0-9])([A-Z])`) and insert `-` between `${1}` and `${2}`. */ -}} {{- /* The replacement is applied globally, so `fooBarLongWord` becomes `foo-Bar-Long-Word` and then `foo-bar-long-word`. */ -}} @@ -117,6 +121,7 @@ metadata: name: {{ $secretName }} labels: {{- include "ldap.labels" $root | nindent 4 }} + {{- include "ldap.backupLabels" . | nindent 4 }} type: Opaque data: {{ $usernameKey | quote }}: {{ $username | b64enc | quote }} diff --git a/k8s/helm/templates/initial-admin-password-secret.yaml b/k8s/helm/templates/initial-admin-password-secret.yaml index 845db2a..a0bfb4f 100644 --- a/k8s/helm/templates/initial-admin-password-secret.yaml +++ b/k8s/helm/templates/initial-admin-password-secret.yaml @@ -14,6 +14,7 @@ metadata: name: {{ $secretName }} labels: {{- include "ldap.labels" . | nindent 4 }} + {{- include "ldap.backupLabels" . | nindent 4 }} type: Opaque data: {{ $passwordKey | quote }}: {{ $password | b64enc | quote }} diff --git a/k8s/helm/templates/statefulset.yaml b/k8s/helm/templates/statefulset.yaml index 92f01d8..d0da4f3 100644 --- a/k8s/helm/templates/statefulset.yaml +++ b/k8s/helm/templates/statefulset.yaml @@ -208,6 +208,7 @@ spec: labels: app: ces {{- include "ldap.labels" . | nindent 10 }} + {{- include "ldap.backupLabels" . | nindent 10 }} spec: accessModes: - ReadWriteOnce From 3d820433fd4a8843515c1949f055cd8a8228b326 Mon Sep 17 00:00:00 2001 From: Niklas Date: Thu, 9 Apr 2026 12:54:44 +0200 Subject: [PATCH 2/3] #81 Add backup labels --- k8s/helm/templates/component-configmap.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/k8s/helm/templates/component-configmap.yaml b/k8s/helm/templates/component-configmap.yaml index e0268be..794b217 100644 --- a/k8s/helm/templates/component-configmap.yaml +++ b/k8s/helm/templates/component-configmap.yaml @@ -13,6 +13,7 @@ metadata: name: {{ $configMapName }} labels: {{- include "ldap.labels" . | nindent 4 }} + {{- include "ldap.backupLabels" . | nindent 4 }} data: config.yaml: |- {{ toYaml .Values.config | indent 4 }} From e165d9327e3230336294dd4defcafba757525dd5 Mon Sep 17 00:00:00 2001 From: Benjamin Ernst Date: Thu, 16 Apr 2026 15:00:18 +0200 Subject: [PATCH 3/3] #84 add k8s.cloudogu.com/restore-scaledown-scope to statefulset --- k8s/helm/templates/_helpers.tpl | 4 ++++ k8s/helm/templates/statefulset.yaml | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/k8s/helm/templates/_helpers.tpl b/k8s/helm/templates/_helpers.tpl index 9c9bcfa..88d1c6c 100644 --- a/k8s/helm/templates/_helpers.tpl +++ b/k8s/helm/templates/_helpers.tpl @@ -30,6 +30,10 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} k8s.cloudogu.com/backup-scope: ldap {{- end }} +{{- define "cas.backupScaleDownLabels" -}} +k8s.cloudogu.com/restore-scaledown-scope: ldap +{{- end }} + {{- define "ldap.kebab" -}} {{- /* Split each lower/digit + upper boundary (`([a-z0-9])([A-Z])`) and insert `-` between `${1}` and `${2}`. */ -}} {{- /* The replacement is applied globally, so `fooBarLongWord` becomes `foo-Bar-Long-Word` and then `foo-bar-long-word`. */ -}} diff --git a/k8s/helm/templates/statefulset.yaml b/k8s/helm/templates/statefulset.yaml index d0da4f3..9901d32 100644 --- a/k8s/helm/templates/statefulset.yaml +++ b/k8s/helm/templates/statefulset.yaml @@ -3,7 +3,8 @@ kind: StatefulSet metadata: name: {{ include "ldap.fullname" . }} labels: - {{- include "ldap.labels" . | nindent 4 }} + {{ include "ldap.labels" . | nindent 4 }} + {{ include "cas.backupScaleDownLabels" . | nindent 4 }} spec: serviceName: {{ include "ldap.fullname" . }} replicas: {{ .Values.replicas | default 1 }}