Skip to content

Commit

Permalink
feat: add recreateStatefulSetOnUpdateInvalid helm chart value (#1127)
Browse files Browse the repository at this point in the history
Signed-off-by: drivebyer <[email protected]>
  • Loading branch information
drivebyer authored Nov 13, 2024
1 parent 147d706 commit 5a8a345
Show file tree
Hide file tree
Showing 19 changed files with 262 additions and 209 deletions.
4 changes: 2 additions & 2 deletions charts/redis-cluster/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: redis-cluster
description: Provides easy redis setup definitions for Kubernetes services, and deployment.
version: 0.16.1
appVersion: "0.16.1"
version: 0.16.2
appVersion: "0.16.2"
home: https://github.com/ot-container-kit/redis-operator
sources:
- https://github.com/ot-container-kit/redis-operator
Expand Down
1 change: 1 addition & 0 deletions charts/redis-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ helm delete <my-release> --namespace <namespace>
| redisCluster.minReadySeconds | int | `0` | |
| redisCluster.name | string | `""` | |
| redisCluster.persistenceEnabled | bool | `true` | |
| redisCluster.recreateStatefulSetOnUpdateInvalid | bool | `false` | Some fields of statefulset are immutable, such as volumeClaimTemplates. When set to true, the operator will delete the statefulset and recreate it. Default is false. |
| redisCluster.redisSecret.secretKey | string | `""` | |
| redisCluster.redisSecret.secretName | string | `""` | |
| redisCluster.resources | object | `{}` | |
Expand Down
5 changes: 4 additions & 1 deletion charts/redis-cluster/templates/redis-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ kind: RedisCluster
metadata:
name: {{ .Values.redisCluster.name | default .Release.Name }}
labels: {{- include "common.labels" . | nindent 4 }}
annotations:
{{ if .Values.redisCluster.recreateStatefulSetOnUpdateInvalid }}
redis.opstreelabs.in/recreate-statefulset: "true"
{{ end }}
spec:
clusterSize: {{ .Values.redisCluster.clusterSize }}
persistenceEnabled: {{ .Values.redisCluster.persistenceEnabled }}
clusterVersion: {{ .Values.redisCluster.clusterVersion }}

redisLeader: {{- include "redis.role" .Values.redisCluster.leader | nindent 4 }}
replicas: {{ .Values.redisCluster.leader.replicas }}
{{- if .Values.externalConfig.enabled }}
Expand Down
3 changes: 3 additions & 0 deletions charts/redis-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ redisCluster:
# cpu: 100m
# memory: 128Mi
minReadySeconds: 0
# -- Some fields of statefulset are immutable, such as volumeClaimTemplates.
# When set to true, the operator will delete the statefulset and recreate it. Default is false.
recreateStatefulSetOnUpdateInvalid: false
leader:
replicas: 3
serviceType: ClusterIP
Expand Down
4 changes: 2 additions & 2 deletions charts/redis-replication/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: redis-replication
description: Provides easy redis setup definitions for Kubernetes services, and deployment.
version: 0.16.3
appVersion: "0.16.3"
version: 0.16.4
appVersion: "0.16.4"
type: application
engine: gotpl
maintainers:
Expand Down
1 change: 1 addition & 0 deletions charts/redis-replication/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ helm delete <my-release> --namespace <namespace>
| redisReplication.imagePullSecrets | list | `[]` | |
| redisReplication.minReadySeconds | int | `0` | |
| redisReplication.name | string | `""` | |
| redisReplication.recreateStatefulSetOnUpdateInvalid | bool | `false` | Some fields of statefulset are immutable, such as volumeClaimTemplates. When set to true, the operator will delete the statefulset and recreate it. Default is false. |
| redisReplication.redisSecret.secretKey | string | `""` | |
| redisReplication.redisSecret.secretName | string | `""` | |
| redisReplication.resources | object | `{}` | |
Expand Down
4 changes: 4 additions & 0 deletions charts/redis-replication/templates/redis-replication.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ kind: RedisReplication
metadata:
name: {{ .Values.redisReplication.name | default .Release.Name }}
labels: {{- include "common.labels" . | nindent 4 }}
annotations:
{{ if .Values.redisReplication.recreateStatefulSetOnUpdateInvalid }}
redis.opstreelabs.in/recreate-statefulset: "true"
{{ end }}
spec:
clusterSize: {{ .Values.redisReplication.clusterSize }}
kubernetesConfig:
Expand Down
5 changes: 4 additions & 1 deletion charts/redis-replication/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ redisReplication:
ignoreAnnotations: []
# - "redis.opstreelabs.in/ignore"
minReadySeconds: 0

# -- Some fields of statefulset are immutable, such as volumeClaimTemplates.
# When set to true, the operator will delete the statefulset and recreate it. Default is false.
recreateStatefulSetOnUpdateInvalid: false

# Overwite name for resources
# name: ""

Expand Down
4 changes: 2 additions & 2 deletions charts/redis-sentinel/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: redis-sentinel
description: Provides easy redis setup definitions for Kubernetes services, and deployment.
version: 0.16.5
appVersion: "0.16.5"
version: 0.16.6
appVersion: "0.16.6"
home: https://github.com/ot-container-kit/redis-operator
sources:
- https://github.com/ot-container-kit/redis-operator
Expand Down
1 change: 1 addition & 0 deletions charts/redis-sentinel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ helm delete <my-release> --namespace <namespace>
| redisSentinel.imagePullSecrets | list | `[]` | |
| redisSentinel.minReadySeconds | int | `0` | |
| redisSentinel.name | string | `""` | |
| redisSentinel.recreateStatefulSetOnUpdateInvalid | bool | `false` | Some fields of statefulset are immutable, such as volumeClaimTemplates. When set to true, the operator will delete the statefulset and recreate it. Default is false. |
| redisSentinel.redisSecret.secretKey | string | `""` | |
| redisSentinel.redisSecret.secretName | string | `""` | |
| redisSentinel.resources | object | `{}` | |
Expand Down
4 changes: 4 additions & 0 deletions charts/redis-sentinel/templates/redis-sentinel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ kind: RedisSentinel
metadata:
name: {{ .Values.redisSentinel.name | default .Release.Name }}
labels: {{- include "common.labels" . | nindent 4 }}
annotations:
{{ if .Values.redisSentinel.recreateStatefulSetOnUpdateInvalid }}
redis.opstreelabs.in/recreate-statefulset: "true"
{{ end }}
spec:
clusterSize: {{ .Values.redisSentinel.clusterSize }}
# Sentinel Config
Expand Down
3 changes: 3 additions & 0 deletions charts/redis-sentinel/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ redisSentinel:
ignoreAnnotations: []
# - "redis.opstreelabs.in/ignore"
minReadySeconds: 0
# -- Some fields of statefulset are immutable, such as volumeClaimTemplates.
# When set to true, the operator will delete the statefulset and recreate it. Default is false.
recreateStatefulSetOnUpdateInvalid: false

# Overwite name for resources
# name: ""
Expand Down
4 changes: 2 additions & 2 deletions charts/redis/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
apiVersion: v2
name: redis
description: Provides easy redis setup definitions for Kubernetes services, and deployment.
version: 0.16.1
appVersion: "0.16.1"
version: 0.16.2
appVersion: "0.16.2"
home: https://github.com/ot-container-kit/redis-operator
sources:
- https://github.com/ot-container-kit/redis-operator
Expand Down
1 change: 1 addition & 0 deletions charts/redis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ helm delete <my-release> --namespace <namespace>
| redisStandalone.imagePullSecrets | list | `[]` | |
| redisStandalone.minReadySeconds | int | `0` | |
| redisStandalone.name | string | `""` | |
| redisStandalone.recreateStatefulSetOnUpdateInvalid | bool | `false` | Some fields of statefulset are immutable, such as volumeClaimTemplates. When set to true, the operator will delete the statefulset and recreate it. Default is false. |
| redisStandalone.redisSecret.secretKey | string | `""` | |
| redisStandalone.redisSecret.secretName | string | `""` | |
| redisStandalone.resources | object | `{}` | |
Expand Down
4 changes: 4 additions & 0 deletions charts/redis/templates/redis-standalone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ kind: Redis
metadata:
name: {{ .Values.redisStandalone.name | default .Release.Name }}
labels: {{- include "common.labels" . | nindent 4 }}
annotations:
{{ if .Values.redisStandalone.recreateStatefulSetOnUpdateInvalid }}
redis.opstreelabs.in/recreate-statefulset: "true"
{{ end }}
spec:
kubernetesConfig:
image: "{{ .Values.redisStandalone.image }}:{{ .Values.redisStandalone.tag }}"
Expand Down
3 changes: 3 additions & 0 deletions charts/redis/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ redisStandalone:
ignoreAnnotations: []
# - "redis.opstreelabs.in/ignore"
minReadySeconds: 0
# -- Some fields of statefulset are immutable, such as volumeClaimTemplates.
# When set to true, the operator will delete the statefulset and recreate it. Default is false.
recreateStatefulSetOnUpdateInvalid: false

labels: {}
# foo: bar
Expand Down
Loading

0 comments on commit 5a8a345

Please sign in to comment.