diff --git a/charts/mongodb/Chart.yaml b/charts/mongodb/Chart.yaml index 298c4d799f5a5772cf3008895d406c5731c4fd8e..09ea1c867e97a36ed11c46541d055a0e88a7cd3f 100644 --- a/charts/mongodb/Chart.yaml +++ b/charts/mongodb/Chart.yaml @@ -7,6 +7,6 @@ type: application maintainers: - name: groundhog2k -version: "0.5.11" +version: "0.5.12" appVersion: "6.0.5" diff --git a/charts/mongodb/README.md b/charts/mongodb/README.md index a405603f88c8cb256a49f04d8d5343ea9ead6537..688983617ade4f43b7153680d71e9ed3759b4e76 100644 --- a/charts/mongodb/README.md +++ b/charts/mongodb/README.md @@ -1,6 +1,6 @@ # MongoDB -   +   ## Changelog @@ -103,6 +103,7 @@ helm uninstall my-release | storage.volumeName | string | `"mongodb-volume"` | Internal volume name and prefix of a created PVC | | storage.requestedSize | string | `nil` | Size for new PVC, when no existing PVC is used | | storage.className | string | `nil` | Storage class name | +| storage.keepPvc | bool | `false` | Keep a created Persistent volume claim when uninstalling the helm chart (only for `useDeploymentWhenNonHA`) | ## MongoDB parameters @@ -126,7 +127,8 @@ helm uninstall my-release | extraSecrets | list | `[]` | A list of additional existing secrets that will be mounted into the container | | extraSecrets[].name | string | `nil` | Name of the existing K8s secret | | extraSecrets[].mountPath | string | `nil` | Mount path where the secret should be mounted into the container (f.e. /mysecretfolder) | -| replicaSet.enabled | bool | `false` | Enables MongoDB ReplicaSet deployment | +| useDeploymentWhenNonHA | bool | `false` | Use Deployment instead of StatefulSet for Non-HA deployments | +| replicaSet.enabled | bool | `false` | Enables MongoDB ReplicaSet deployment (HA mode) | | replicaSet.name | string | `nil` | Name of this MongoDB ReplicaSet | | replicaSet.key | string | `nil` | Base 64-encoded string with 6-1024 characters used as authentication key for internal communication | | replicaSet.keySecretName | string | `nil` | Alternative to `key` - Name of an existing secret with a file named "keyfile" containing the base64 encoded key string | diff --git a/charts/mongodb/RELEASENOTES.md b/charts/mongodb/RELEASENOTES.md index 074f3355e7cdc5d32131b608f4c2365d45e065a9..3128a4f9a5609bfe7aba159dda4e9b2be97ef16a 100644 --- a/charts/mongodb/RELEASENOTES.md +++ b/charts/mongodb/RELEASENOTES.md @@ -61,4 +61,5 @@ | 0.5.9 | 6.0.3 | Fixed values documentation - thx @generalovmaksim | | 0.5.10 | 6.0.4 | Upgraded to MongoDB 6.0.4 | | 0.5.11 | 6.0.5 | Upgraded to MongoDB 6.0.5 | +| 0.5.12 | 6.0.5 | Implemented alternative distribution with `Deployment` template | | | | | diff --git a/charts/mongodb/templates/pvc.yaml b/charts/mongodb/templates/pvc.yaml new file mode 100644 index 0000000000000000000000000000000000000000..62ecdac08ef4132fc14df9c47d09b0ee0f6a2677 --- /dev/null +++ b/charts/mongodb/templates/pvc.yaml @@ -0,0 +1,27 @@ +{{- if and (not .Values.replicaSet.enabled) (.Values.useDeploymentWhenNonHA) }} +{{- $createPvc := and (empty .Values.storage.persistentVolumeClaimName) (.Values.storage.requestedSize) }} +{{- if $createPvc }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "mongodb.fullname" . }} + labels: + {{- include "mongodb.labels" . | nindent 4 }} + {{- if .Values.storage.keepPvc }} + annotations: + "helm.sh/resource-policy": keep + {{- end }} +spec: + {{- with .Values.storage }} + accessModes: + {{- toYaml .accessModes | nindent 4 }} + volumeMode: Filesystem + resources: + requests: + storage: {{ .requestedSize }} + {{- if .className }} + storageClassName: {{ .className }} + {{- end }} + {{- end }} +{{- end }} +{{- end }} diff --git a/charts/mongodb/templates/statefulset.yaml b/charts/mongodb/templates/statefulset.yaml index 571faf4b92d6ae8e20433b49e4ebe383900202bf..376438c98b8e46d301bb15271d1fe686e0ac4273 100644 --- a/charts/mongodb/templates/statefulset.yaml +++ b/charts/mongodb/templates/statefulset.yaml @@ -1,25 +1,37 @@ +{{- $createPvc := and (empty .Values.storage.persistentVolumeClaimName) (.Values.storage.requestedSize) }} +{{- $deployWithNonHA := and (not .Values.replicaSet.enabled) (.Values.useDeploymentWhenNonHA) }} +{{- $fullname := include "mongodb.fullname" . }} apiVersion: apps/v1 +{{- if $deployWithNonHA }} +kind: Deployment +{{- else }} kind: StatefulSet +{{- end }} metadata: - name: {{ include "mongodb.fullname" . }} + name: {{ $fullname }} labels: {{- include "mongodb.labels" . | nindent 4 }} service-type: primary-secondary spec: - selector: - matchLabels: - {{- include "mongodb.selectorLabels" . | nindent 6 }} - service-type: primary-secondary - serviceName: {{ include "mongodb.fullname" . }}-{{ .Values.service.headlessServiceSuffix }} - podManagementPolicy: {{ .Values.podManagementPolicy }} {{- if .Values.replicaSet.enabled }} replicas: {{ add1 .Values.replicaSet.secondaries }} {{- end }} {{- if .Values.revisionHistoryLimit }} revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} {{- end }} - updateStrategy: - type: {{ .Values.updateStrategyType }} + {{- if or (.Values.replicaSet.enabled) (not .Values.useDeploymentWhenNonHA) }} + serviceName: {{ $fullname }}-{{ .Values.service.headlessServiceSuffix }} + podManagementPolicy: {{ .Values.podManagementPolicy }} + updateStrategy: + type: {{ .Values.updateStrategyType }} + {{- else }} + strategy: + type: Recreate + {{- end }} + selector: + matchLabels: + {{- include "mongodb.selectorLabels" . | nindent 6 }} + service-type: primary-secondary template: metadata: annotations: @@ -180,7 +192,7 @@ spec: envFrom: {{- if include "mongodb.createSecureConfig" . }} - secretRef: - name: {{ include "mongodb.fullname" . }} + name: {{ $fullname }} {{- end }} {{- range .Values.extraEnvSecrets }} - secretRef: @@ -237,7 +249,7 @@ spec: emptyDir: {} - name: scripts configMap: - name: {{ include "mongodb.fullname" . }}-scripts + name: {{ $fullname }}-scripts defaultMode: 0555 {{- if .Values.extraScripts }} - name: extrascripts-volume @@ -248,7 +260,7 @@ spec: {{- if .Values.customScripts }} - name: customscripts-volume configMap: - name: {{ include "mongodb.fullname" . }}-customscripts + name: {{ $fullname }}-customscripts defaultMode: 0555 {{- end }} {{- if .Values.extraSecretConfigs }} @@ -259,7 +271,7 @@ spec: {{- if .Values.customConfig }} - name: customconfig-volume configMap: - name: {{ include "mongodb.fullname" . }}-customconfig + name: {{ $fullname }}-customconfig {{- end }} {{- range $secret := .Values.extraSecrets }} - name: {{ $secret.name }} @@ -274,7 +286,6 @@ spec: defaultMode: 0400 {{- end }} {{- with .Values.storage }} - {{- $createPvc := and (empty .persistentVolumeClaimName) .requestedSize }} {{- if not $createPvc }} - name: {{ .volumeName }} {{- if .persistentVolumeClaimName }} @@ -284,6 +295,11 @@ spec: emptyDir: {} {{- end }} {{- else }} + {{- if $deployWithNonHA }} + - name: {{ .volumeName }} + persistentVolumeClaim: + claimName: {{ $fullname }} + {{- else }} volumeClaimTemplates: - metadata: name: {{ .volumeName }} @@ -299,5 +315,6 @@ spec: requests: storage: {{ .requestedSize }} {{- end }} + {{- end }} {{- end }} \ No newline at end of file diff --git a/charts/mongodb/values.yaml b/charts/mongodb/values.yaml index 51f950c5c0476829da49bc2cae27fc908f6f5227..97b0eccc522deb7924d8b782f03a578e919d1085 100644 --- a/charts/mongodb/values.yaml +++ b/charts/mongodb/values.yaml @@ -121,7 +121,10 @@ extraInitContainers: [] ## Extra containers for usage as sidecars extraContainers: [] -## Parameters to build a MongoDB replica set +## Use Kubernetes Deployment instead of StatefulSet when in Non-HA mode +useDeploymentWhenNonHA: false + +## Parameters to build a MongoDB replica set (HA mode) replicaSet: ## Enables replica set deployment mode enabled: false @@ -270,3 +273,6 @@ storage: ## Default access mode (ReadWriteOnce) accessModes: - ReadWriteOnce + + ## Keep a created Persistent volume claim when uninstalling the helm chart (only for non-HA mode with option useDeploymentWhenNonHA: true) + keepPvc: false diff --git a/charts/mysql/Chart.yaml b/charts/mysql/Chart.yaml index d77294edf9491af4cb6a807a56ec123762350479..3c1607e8c39de931b4e81733c2c1904d4a562f7d 100644 --- a/charts/mysql/Chart.yaml +++ b/charts/mysql/Chart.yaml @@ -7,6 +7,6 @@ type: application maintainers: - name: groundhog2k -version: 0.1.6 +version: "0.1.7" appVersion: "8.0.32-oracle" diff --git a/charts/mysql/README.md b/charts/mysql/README.md index f238c32668ae94b497600f13aba94b69980276fa..6f3416e1f22820fccb26da790d1d5d10aa3636db 100644 --- a/charts/mysql/README.md +++ b/charts/mysql/README.md @@ -1,6 +1,6 @@ # MySQL -   +   ## Changelog @@ -103,11 +103,13 @@ helm uninstall my-release | storage.volumeName | string | `"db-volume"` | Internal volume name and prefix of a created PVC | | storage.requestedSize | string | `nil` | Size for new PVC, when no existing PVC is used | | storage.className | string | `nil` | Storage class name | +| storage.keepPvc | bool | `false` | Keep a created Persistent volume claim when uninstalling the helm chart (only for option `useDeployment: true`) | ## MySQL parameters | Key | Type | Default | Description | |-----|------|---------|-------------| +| useDeployment | bool | `false` | Use Kubernetes Deployment instead of StatefulSet | | userDatabase | object | `{}` | Optional MySQL user database | | userDatabase.name | string | `""` | Name of the user database | | userDatabase.user | string | `""` | User name with full access to user database| diff --git a/charts/mysql/RELEASENOTES.md b/charts/mysql/RELEASENOTES.md index 99b16b8ea2dca81d204b19061f74faecf52b6bfa..f4fb6a2eaaf58c83d78d6a9411ce7ab8ccb32e3f 100644 --- a/charts/mysql/RELEASENOTES.md +++ b/charts/mysql/RELEASENOTES.md @@ -9,4 +9,5 @@ | 0.1.4 | 8.0.31 | Upgraded MySQL to 8.0.31 | | 0.1.5 | 8.0.31 | Added support for init container resources (thx @Footur) | | 0.1.6 | 8.0.32 | Upgraded MySQL to 8.0.32 | +| 0.1.7 | 8.0.32 | Implemented alternative distribution with `Deployment` template | | | | | diff --git a/charts/mysql/templates/pvc.yaml b/charts/mysql/templates/pvc.yaml new file mode 100644 index 0000000000000000000000000000000000000000..37d4ee5df09813b56df50c7a8120452a29f2fe64 --- /dev/null +++ b/charts/mysql/templates/pvc.yaml @@ -0,0 +1,27 @@ +{{- if .Values.useDeployment }} +{{- $createPvc := and (empty .Values.storage.persistentVolumeClaimName) (.Values.storage.requestedSize) }} +{{- if $createPvc }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "mysql.fullname" . }} + labels: + {{- include "mysql.labels" . | nindent 4 }} + {{- if .Values.storage.keepPvc }} + annotations: + "helm.sh/resource-policy": keep + {{- end }} +spec: + {{- with .Values.storage }} + accessModes: + {{- toYaml .accessModes | nindent 4 }} + volumeMode: Filesystem + resources: + requests: + storage: {{ .requestedSize }} + {{- if .className }} + storageClassName: {{ .className }} + {{- end }} + {{- end }} +{{- end }} +{{- end }} diff --git a/charts/mysql/templates/statefulset.yaml b/charts/mysql/templates/statefulset.yaml index 68f2fe3c963eeffa9e625989caf4cdc01e81afe7..710a721872bde40db20829ca38cef8398fb4ea9f 100644 --- a/charts/mysql/templates/statefulset.yaml +++ b/charts/mysql/templates/statefulset.yaml @@ -1,7 +1,13 @@ +{{- $usedeployment := .Values.useDeployment }} +{{- $fullname := include "mysql.fullname" . }} apiVersion: apps/v1 +{{- if $usedeployment }} +kind: Deployment +{{- else }} kind: StatefulSet +{{- end }} metadata: - name: {{ include "mysql.fullname" . }} + name: {{ $fullname }} labels: {{- include "mysql.labels" . | nindent 4 }} spec: @@ -9,10 +15,15 @@ spec: {{- if .Values.revisionHistoryLimit }} revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} {{- end }} - serviceName: {{ include "mysql.fullname" . }} + {{- if not $usedeployment }} + serviceName: {{ $fullname }} podManagementPolicy: {{ .Values.podManagementPolicy }} updateStrategy: type: {{ .Values.updateStrategyType }} + {{- else }} + strategy: + type: Recreate + {{- end }} selector: matchLabels: {{- include "mysql.selectorLabels" . | nindent 6 }} @@ -189,7 +200,7 @@ spec: envFrom: {{- if include "mysql.createSecureConfig" . }} - secretRef: - name: {{ include "mysql.fullname" . }} + name: {{ $fullname }} {{- end }} {{- range .Values.extraEnvSecrets }} - secretRef: @@ -219,12 +230,12 @@ spec: emptyDir: {} - name: initscripts configMap: - name: {{ include "mysql.fullname" . }}-scripts + name: {{ $fullname }}-scripts defaultMode: 0555 {{- if .Values.customScripts }} - name: customscripts-volume configMap: - name: {{ include "mysql.fullname" . }}-customscripts + name: {{ $fullname }}-customscripts defaultMode: 0555 {{- end }} {{- if .Values.extraSecretConfigs }} @@ -235,7 +246,7 @@ spec: {{- if .Values.customConfig }} - name: customconfig-volume configMap: - name: {{ include "mysql.fullname" . }} + name: {{ $fullname }} {{- end }} {{- if .Values.extraScripts }} - name: extrascripts-volume @@ -249,7 +260,6 @@ spec: secretName: {{ $secret.name }} defaultMode: 0440 {{- end }} -{{- $fullname := include "mysql.fullname" . }} {{- with .Values.storage }} {{- $createPvc := and (empty .persistentVolumeClaimName) .requestedSize }} {{- if not $createPvc }} @@ -261,6 +271,11 @@ spec: emptyDir: {} {{- end }} {{- else }} + {{- if $usedeployment }} + - name: {{ .volumeName }} + persistentVolumeClaim: + claimName: {{ $fullname }} + {{- else }} volumeClaimTemplates: - metadata: name: {{ .volumeName }} @@ -276,4 +291,5 @@ spec: requests: storage: {{ .requestedSize }} {{- end }} + {{- end }} {{- end }} diff --git a/charts/mysql/values.yaml b/charts/mysql/values.yaml index 05d338e02f30b2b3b3f79e7ab0fa581b694fd98a..c72ff9a2bf5828b8978fb98a80e8cf22d9fc05c4 100644 --- a/charts/mysql/values.yaml +++ b/charts/mysql/values.yaml @@ -131,6 +131,9 @@ extraContainers: [] ## Additional environment variables env: [] +## Use Kubernetes Deployment instead of StatefulSet +useDeployment: false + ## Database configuration settings: ## Arguments for the container entrypoint process @@ -206,3 +209,6 @@ storage: ## Default access mode (ReadWriteOnce) accessModes: - ReadWriteOnce + + ## Keep a created Persistent volume claim when uninstalling the helm chart (only for option useDeployment: true) + keepPvc: false diff --git a/charts/postgres/Chart.yaml b/charts/postgres/Chart.yaml index 2cc0e1427029bca24964d90b5fb25b644519be75..8605444b083efa28eef23e7e025c5d96205f252f 100644 --- a/charts/postgres/Chart.yaml +++ b/charts/postgres/Chart.yaml @@ -7,6 +7,6 @@ type: application maintainers: - name: groundhog2k -version: "0.4.2" +version: "0.4.3" appVersion: "15.2" diff --git a/charts/postgres/README.md b/charts/postgres/README.md index 8f24517baf70993f4bea5d13124b50b16513ae6b..f963b5a258c9ece301ac0c0af299ef39a6173d54 100644 --- a/charts/postgres/README.md +++ b/charts/postgres/README.md @@ -1,6 +1,6 @@ # PostgreSQL -   +   ## Changelog @@ -107,10 +107,13 @@ helm uninstall my-release | storage.volumeName | string | `"postgres-data"` | Internal volume name and prefix of a created PVC | | storage.requestedSize | string | `nil` | Size for new PVC, when no existing PVC is used | | storage.className | string | `nil` | Storage class name | +| storage.keepPvc | bool | `false` | Keep a created Persistent volume claim when uninstalling the helm chart (only for option `useDeployment: true`) | + ## PostgreSQL parameters | Key | Type | Default | Description | |-----|------|---------|-------------| +| useDeployment | bool | `false` | Use Kubernetes Deployment instead of StatefulSet | | settings.authMethod | string | `nil` | Postgres database authentication method | | settings.initDbArgs | string | `nil` | Optional init database arguments | | settings.superuser | string | `nil` | Superuser name | diff --git a/charts/postgres/RELEASENOTES.md b/charts/postgres/RELEASENOTES.md index b660a93a61a15af74a35b36b724c74834f23939e..5de05449a9dadb165bc2100d9692d1e42e2279c7 100644 --- a/charts/postgres/RELEASENOTES.md +++ b/charts/postgres/RELEASENOTES.md @@ -26,4 +26,5 @@ | 0.4.0 | 15.0 | Upgraded to Postgres 15.0 | | 0.4.1 | 15.1 | Upgraded to Postgres 15.1 | | 0.4.2 | 15.2 | Upgraded to Postgres 15.2 | +| 0.4.3 | 15.2 | Implemented alternative distribution with `Deployment` template | | | | | diff --git a/charts/postgres/templates/pvc.yaml b/charts/postgres/templates/pvc.yaml new file mode 100644 index 0000000000000000000000000000000000000000..50c49d2dcaac1c178fd29a1065bcd4a85e0f8081 --- /dev/null +++ b/charts/postgres/templates/pvc.yaml @@ -0,0 +1,27 @@ +{{- if .Values.useDeployment }} +{{- $createPvc := and (empty .Values.storage.persistentVolumeClaimName) (.Values.storage.requestedSize) }} +{{- if $createPvc }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "postgres.fullname" . }} + labels: + {{- include "postgres.labels" . | nindent 4 }} + {{- if .Values.storage.keepPvc }} + annotations: + "helm.sh/resource-policy": keep + {{- end }} +spec: + {{- with .Values.storage }} + accessModes: + {{- toYaml .accessModes | nindent 4 }} + volumeMode: Filesystem + resources: + requests: + storage: {{ .requestedSize }} + {{- if .className }} + storageClassName: {{ .className }} + {{- end }} + {{- end }} +{{- end }} +{{- end }} diff --git a/charts/postgres/templates/statefulset.yaml b/charts/postgres/templates/statefulset.yaml index e3a5469b4b6ce60c4e55f9e6b60a760148f4e218..2b98effa5a54b89227d136a10f0a728112af51b2 100644 --- a/charts/postgres/templates/statefulset.yaml +++ b/charts/postgres/templates/statefulset.yaml @@ -1,7 +1,13 @@ +{{- $usedeployment := .Values.useDeployment }} +{{- $fullname := include "postgres.fullname" . }} apiVersion: apps/v1 +{{- if $usedeployment }} +kind: Deployment +{{- else }} kind: StatefulSet +{{- end }} metadata: - name: {{ include "postgres.fullname" . }} + name: {{ $fullname }} labels: {{- include "postgres.labels" . | nindent 4 }} spec: @@ -9,10 +15,15 @@ spec: {{- if .Values.revisionHistoryLimit }} revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} {{- end }} - serviceName: {{ include "postgres.fullname" . }} + {{- if not $usedeployment }} + serviceName: {{ $fullname }} podManagementPolicy: {{ .Values.podManagementPolicy }} updateStrategy: type: {{ .Values.updateStrategyType }} + {{- else }} + strategy: + type: Recreate + {{- end }} selector: matchLabels: {{- include "postgres.selectorLabels" . | nindent 6 }} @@ -102,7 +113,7 @@ spec: envFrom: {{- if include "postgres.createSecureConfig" . }} - secretRef: - name: {{ include "postgres.fullname" . }} + name: {{ $fullname }} {{- end }} {{- range .Values.extraEnvSecrets }} - secretRef: @@ -219,7 +230,7 @@ spec: emptyDir: {} - name: initscripts configMap: - name: {{ include "postgres.fullname" . }}-scripts + name: {{ $fullname }}-scripts defaultMode: 0555 {{- if .Values.extraScripts }} - name: extrascripts-volume @@ -230,7 +241,7 @@ spec: {{- if .Values.customScripts }} - name: customscripts-volume configMap: - name: {{ include "postgres.fullname" . }}-customscripts + name: {{ $fullname }}-customscripts defaultMode: 0555 {{- end }} {{- if .Values.extraSecretConfigs }} @@ -241,7 +252,7 @@ spec: {{- if .Values.customConfig }} - name: customconfig-volume configMap: - name: {{ include "postgres.fullname" . }}-customconfig + name: {{ $fullname }}-customconfig {{- end }} {{- range $secret := .Values.extraSecrets }} - name: {{ $secret.name }} @@ -260,6 +271,11 @@ spec: emptyDir: {} {{- end }} {{- else }} + {{- if $usedeployment }} + - name: {{ .volumeName }} + persistentVolumeClaim: + claimName: {{ $fullname }} + {{- else }} volumeClaimTemplates: - metadata: name: {{ .volumeName }} @@ -275,4 +291,5 @@ spec: requests: storage: {{ .requestedSize }} {{- end }} + {{- end }} {{- end }} diff --git a/charts/postgres/values.yaml b/charts/postgres/values.yaml index ccd87ff04bd7628d826ed9e86d679d2216ae5f4f..ed0d8f94eaee10c9c87ed8a104a718f4641ddfbf 100644 --- a/charts/postgres/values.yaml +++ b/charts/postgres/values.yaml @@ -124,6 +124,9 @@ env: [] ## Arguments for the container entrypoint process args: [] +## Use Kubernetes Deployment instead of StatefulSet +useDeployment: false + ## Database configuration settings: ## The default postgres superuser (default when nothing is set: "postgres") @@ -199,3 +202,6 @@ storage: ## Default access mode (ReadWriteOnce) accessModes: - ReadWriteOnce + + ## Keep a created Persistent volume claim when uninstalling the helm chart (only for option useDeployment: true) + keepPvc: false diff --git a/charts/redis/Chart.yaml b/charts/redis/Chart.yaml index 39433304c8c05891e7b438ad0ad93f0d99d633a8..bcd07e37a80b988e2ff8ed124c6fab994ba00763 100644 --- a/charts/redis/Chart.yaml +++ b/charts/redis/Chart.yaml @@ -8,7 +8,7 @@ maintainers: - name: groundhog2k # This is the chart version -version: "0.6.7" +version: "0.6.8" # This is the version number of the application being deployed. appVersion: "7.0.10" diff --git a/charts/redis/README.md b/charts/redis/README.md index 4076fa12ede5b6f7ff66bcc435508c50ff2e24eb..8bb368cdf216c66f7a79188bb973043862b359c5 100644 --- a/charts/redis/README.md +++ b/charts/redis/README.md @@ -1,6 +1,6 @@ # Redis -   +   ## Changelog @@ -140,6 +140,7 @@ helm uninstall my-release |-----|------|---------|-------------| | storage.accessModes[0] | string | `"ReadWriteOnce"` | Storage access mode | | storage.persistentVolumeClaimName | string | `nil` | PVC name when existing storage volume should be used | +| storage.volumeName | string | `"redis-data"` | Internal volume name and prefix of a created PVC | | storage.requestedSize | string | `nil` | Size for new PVC, when no existing PVC is used | | storage.className | string | `nil` | Storage class name | | storage.keepPvc | bool | `false` | Keep a created Persistent volume claim when uninstalling the helm chart (only for `useDeploymentWhenNonHA`) | diff --git a/charts/redis/RELEASENOTES.md b/charts/redis/RELEASENOTES.md index d10e95a9fdcbb1d285ee38d2950790eac17d00bc..68be4508efb05946200f0e8db36beca049dcdf46 100644 --- a/charts/redis/RELEASENOTES.md +++ b/charts/redis/RELEASENOTES.md @@ -27,4 +27,5 @@ | 0.6.5 | 7.0.10 | Upgraded to Redis 7.0.10 | | 0.6.6 | 7.0.10 | Fixed redis volume deployment in non-HA mode | | 0.6.7 | 7.0.10 | Fix default update strategy to `Recreate` for distribution with `Deployment` | +| 0.6.8 | 7.0.10 | Made internal volume name configurable | | | | | diff --git a/charts/redis/templates/statefulset.yaml b/charts/redis/templates/statefulset.yaml index 28bc4b509517f9f396d21ecfaacec93130dea7b4..f089aaf247562e4b9db56c8d336715063cc72b5c 100644 --- a/charts/redis/templates/statefulset.yaml +++ b/charts/redis/templates/statefulset.yaml @@ -62,7 +62,7 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} volumeMounts: - mountPath: /data - name: redis-data + name: {{ .Values.storage.volumeName }} - name: scripts mountPath: /scripts {{- if .Values.redisConfig }} @@ -184,7 +184,7 @@ spec: name: {{ . }} {{- end }} volumeMounts: - - name: redis-data + - name: {{ .Values.storage.volumeName }} mountPath: /data {{- range $secret := .Values.extraRedisSecrets }} - name: {{ $secret.name }} @@ -263,7 +263,7 @@ spec: name: {{ . }} {{- end }} volumeMounts: - - name: redis-data + - name: {{ .Values.storage.volumeName }} mountPath: /data {{- range $secret := .Values.extraSentinelSecrets }} - name: {{ $secret.name }} @@ -319,7 +319,7 @@ spec: {{- end }} {{- with .Values.storage }} {{- if not $createPvc }} - - name: redis-data + - name: {{ .volumeName }} {{- if .persistentVolumeClaimName }} persistentVolumeClaim: claimName: {{ .persistentVolumeClaimName }} @@ -328,13 +328,13 @@ spec: {{- end }} {{- else }} {{- if $deployWithNonHA }} - - name: redis-data + - name: {{ .volumeName }} persistentVolumeClaim: claimName: {{ $fullname }} {{- else }} volumeClaimTemplates: - metadata: - name: redis-data + name: {{ .volumeName }} spec: {{- with .accessModes }} accessModes: diff --git a/charts/redis/values.yaml b/charts/redis/values.yaml index 48298063585f7de3ef0a5ce5300c42f1583f5233..8f124ce96b43172123c6922d05a138903466371c 100644 --- a/charts/redis/values.yaml +++ b/charts/redis/values.yaml @@ -227,6 +227,9 @@ storage: ## Set persistentVolumenClaimName to reference an existing PVC persistentVolumeClaimName: + ## Internal volume name and prefix of a created PVC + volumeName: "redis-data" + ## Alternative set requestedSize to define a size for a dynmaically created PVC requestedSize: