Skip to content

Commit 6161257

Browse files
fix: maxMemoryPercentOfLimit missing in helm charts (#1559)
* fix: missing maxMemoryPercentOfLimit in helm charts Signed-off-by: tingwei628 <[email protected]> * fix: helm lint error Signed-off-by: tingwei628 <[email protected]> * add values * fix syntax * fix syntax --------- Signed-off-by: tingwei628 <[email protected]> Co-authored-by: yangw <[email protected]>
1 parent 94a9516 commit 6161257

File tree

9 files changed

+42
-11
lines changed

9 files changed

+42
-11
lines changed

charts/redis-cluster/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ helm delete <my-release> --namespace <namespace>
7070
| priorityClassName | string | `""` | |
7171
| redisCluster.clusterSize | int | `3` | Default number of replicas for both leader and follower when not explicitly set |
7272
| redisCluster.clusterVersion | string | `"v7"` | |
73-
| redisCluster.enableMasterSlaveAntiAffinity | bool | `false` | Enable pod anti-affinity between leader and follower pods by adding the appropriate label. Notice that this requires the operator to have its mutating webhook enabled, otherwise it will only add an annotation to the RedisCluster CR. Default is false. |
73+
| redisCluster.enableMasterSlaveAntiAffinity | bool | `false` | Enable pod anti-affinity between leader and follower pods by adding the appropriate label. Notice that this requires the operator to have its mutating webhook enabled, otherwise it will only add an annotation to the RedisCluster CR. Default is false. |
7474
| redisCluster.follower.affinity | string | `nil` | |
7575
| redisCluster.follower.livenessProbe | object | `{}` | |
7676
| redisCluster.follower.nodeSelector | string | `nil` | |
@@ -96,10 +96,11 @@ helm delete <my-release> --namespace <namespace>
9696
| redisCluster.leader.securityContext | object | `{}` | |
9797
| redisCluster.leader.serviceType | string | `"ClusterIP"` | |
9898
| redisCluster.leader.tolerations | list | `[]` | |
99+
| redisCluster.maxMemoryPercentOfLimit | int | `0` | MaxMemoryPercentOfLimit is the percentage of redis container memory limit to be used as maxmemory. Default is 0 (disabled). |
99100
| redisCluster.minReadySeconds | int | `0` | |
100101
| redisCluster.name | string | `""` | |
101102
| redisCluster.persistenceEnabled | bool | `true` | |
102-
| 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. |
103+
| 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. |
103104
| redisCluster.redisSecret.secretKey | string | `""` | |
104105
| redisCluster.redisSecret.secretName | string | `""` | |
105106
| redisCluster.resources | object | `{}` | |

charts/redis-cluster/templates/redis-cluster.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,23 @@ spec:
1717
clusterVersion: {{ .Values.redisCluster.clusterVersion }}
1818
redisLeader: {{- include "redis.role" .Values.redisCluster.leader | nindent 4 }}
1919
replicas: {{ .Values.redisCluster.leader.replicas }}
20-
{{- if .Values.externalConfig.enabled }}
20+
{{- if .Values.externalConfig.enabled }}
2121
redisConfig:
2222
additionalRedisConfig: "{{ .Values.redisCluster.name | default .Release.Name }}-ext-config"
23-
{{- end }}
23+
{{- end }}
2424

2525
redisFollower: {{- include "redis.role" .Values.redisCluster.follower | nindent 4 }}
2626
replicas: {{ .Values.redisCluster.follower.replicas }}
27-
{{- if .Values.externalConfig.enabled }}
27+
{{- if .Values.externalConfig.enabled }}
2828
redisConfig:
2929
additionalRedisConfig: "{{ .Values.redisCluster.name | default .Release.Name }}-ext-config"
30+
{{- end }}
31+
32+
{{- if .Values.redisCluster.maxMemoryPercentOfLimit }}
33+
{{- if gt .Values.redisCluster.maxMemoryPercentOfLimit 0 }}
34+
redisConfig:
35+
maxMemoryPercentOfLimit: {{ .Values.redisCluster.maxMemoryPercentOfLimit }}
36+
{{- end }}
3037
{{- end }}
3138

3239
redisExporter:

charts/redis-cluster/values.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,16 @@ redisCluster:
2222
# memory: 128Mi
2323
minReadySeconds: 0
2424
# -- Some fields of statefulset are immutable, such as volumeClaimTemplates.
25-
# When set to true, the operator will delete the statefulset and recreate it. Default is false.
25+
# When set to true, the operator will delete the statefulset and recreate it.
26+
# Default is false.
2627
recreateStatefulSetOnUpdateInvalid: false
28+
# -- MaxMemoryPercentOfLimit is the percentage of redis container memory limit to be used as maxmemory.
29+
# Default is 0 (disabled).
30+
maxMemoryPercentOfLimit: 0
2731
# -- Enable pod anti-affinity between leader and follower pods by adding the appropriate label.
28-
# Notice that this requires the operator to have its mutating webhook enabled,
29-
# otherwise it will only add an annotation to the RedisCluster CR. Default is false.
32+
# Notice that this requires the operator to have its mutating webhook enabled,
33+
# otherwise it will only add an annotation to the RedisCluster CR.
34+
# Default is false.
3035
enableMasterSlaveAntiAffinity: false
3136
leader:
3237
# -- Number of Redis leader (master) nodes. If not set, uses clusterSize value

charts/redis-replication/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ helm delete <my-release> --namespace <namespace>
8383
| redisReplication.image | string | `"quay.io/opstree/redis"` | |
8484
| redisReplication.imagePullPolicy | string | `"IfNotPresent"` | |
8585
| redisReplication.imagePullSecrets | list | `[]` | |
86+
| redisReplication.maxMemoryPercentOfLimit | int | `0` | MaxMemoryPercentOfLimit is the percentage of redis container memory limit to be used as maxmemory. Default is 0 (disabled). |
8687
| redisReplication.minReadySeconds | int | `0` | |
8788
| redisReplication.name | string | `""` | |
8889
| 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. |

charts/redis-replication/templates/redis-replication.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,15 @@ spec:
4545
securityContext: {{ toYaml .Values.redisExporter.securityContext | nindent 6 }}
4646
{{- end }}
4747

48-
{{- if .Values.externalConfig.enabled }}
4948
redisConfig:
49+
{{- if .Values.externalConfig.enabled }}
5050
additionalRedisConfig: "{{ .Values.redisReplication.name | default .Release.Name }}-ext-config"
5151
{{- end }}
52+
{{- if .Values.redisReplication.maxMemoryPercentOfLimit }}
53+
{{- if gt .Values.redisReplication.maxMemoryPercentOfLimit 0 }}
54+
maxMemoryPercentOfLimit: {{ .Values.redisReplication.maxMemoryPercentOfLimit }}
55+
{{- end }}
56+
{{- end }}
5257
{{- if .Values.storageSpec }}
5358
storage: {{ toYaml .Values.storageSpec | nindent 4 }}
5459
{{- end }}

charts/redis-replication/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ redisReplication:
2424
# -- Some fields of statefulset are immutable, such as volumeClaimTemplates.
2525
# When set to true, the operator will delete the statefulset and recreate it. Default is false.
2626
recreateStatefulSetOnUpdateInvalid: false
27+
# -- MaxMemoryPercentOfLimit is the percentage of redis container memory limit to be used as maxmemory.
28+
# Default is 0 (disabled).
29+
maxMemoryPercentOfLimit: 0
2730

2831
# Overwite name for resources
2932
# name: ""

charts/redis/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ helm delete <my-release> --namespace <namespace>
7878
| redisStandalone.image | string | `"quay.io/opstree/redis"` | |
7979
| redisStandalone.imagePullPolicy | string | `"IfNotPresent"` | |
8080
| redisStandalone.imagePullSecrets | list | `[]` | |
81+
| redisStandalone.maxMemoryPercentOfLimit | int | `0` | MaxMemoryPercentOfLimit is the percentage of redis container memory limit to be used as maxmemory. Default is 0 (disabled). |
8182
| redisStandalone.minReadySeconds | int | `0` | |
8283
| redisStandalone.name | string | `""` | |
8384
| 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. |

charts/redis/templates/redis-standalone.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,16 @@ spec:
4343
{{- if .Values.redisExporter.securityContext}}
4444
securityContext: {{ toYaml .Values.redisExporter.securityContext | nindent 6 }}
4545
{{- end }}
46-
47-
{{- if .Values.externalConfig.enabled }}
46+
4847
redisConfig:
48+
{{- if .Values.externalConfig.enabled }}
4949
additionalRedisConfig: "{{ .Values.redisStandalone.name | default .Release.Name }}-ext-config"
5050
{{- end }}
51+
{{- if .Values.redisStandalone.maxMemoryPercentOfLimit }}
52+
{{- if gt .Values.redisStandalone.maxMemoryPercentOfLimit 0 }}
53+
maxMemoryPercentOfLimit: {{ .Values.redisStandalone.maxMemoryPercentOfLimit }}
54+
{{- end }}
55+
{{- end }}
5156
{{- if .Values.storageSpec }}
5257
storage: {{ toYaml .Values.storageSpec | nindent 4 }}
5358
{{- end }}

charts/redis/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ redisStandalone:
2323
# -- Some fields of statefulset are immutable, such as volumeClaimTemplates.
2424
# When set to true, the operator will delete the statefulset and recreate it. Default is false.
2525
recreateStatefulSetOnUpdateInvalid: false
26+
# -- MaxMemoryPercentOfLimit is the percentage of redis container memory limit to be used as maxmemory.
27+
# Default is 0 (disabled).
28+
maxMemoryPercentOfLimit: 0
2629

2730
labels: {}
2831
# foo: bar

0 commit comments

Comments
 (0)