Skip to content

Commit 01a26c9

Browse files
committed
chore(addon): update redis use sentinel mode
1 parent a02c705 commit 01a26c9

22 files changed

Lines changed: 567 additions & 8 deletions

File tree

addons/redis-1.1.0/chart/redis/templates/sentinel/statefulset.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ spec:
108108
command: {{- include "common.tplvalues.render" (dict "value" .Values.replica.command "context" $) | nindent 12 }}
109109
{{- else }}
110110
command:
111+
- init-stack
111112
- /bin/bash
112113
{{- end }}
113114
{{- if .Values.diagnosticMode.enabled }}
@@ -208,6 +209,7 @@ spec:
208209
failureThreshold: {{ .Values.replica.livenessProbe.failureThreshold }}
209210
exec:
210211
command:
212+
- init-stack
211213
- sh
212214
- -c
213215
- /health/ping_liveness_local.sh {{ .Values.replica.livenessProbe.timeoutSeconds }}
@@ -223,6 +225,7 @@ spec:
223225
failureThreshold: {{ .Values.replica.readinessProbe.failureThreshold }}
224226
exec:
225227
command:
228+
- init-stack
226229
- sh
227230
- -c
228231
- /health/ping_readiness_local.sh {{ .Values.replica.livenessProbe.timeoutSeconds }}
@@ -267,6 +270,7 @@ spec:
267270
preStop:
268271
exec:
269272
command:
273+
- init-stack
270274
- /bin/bash
271275
- -c
272276
- /opt/drycc/scripts/start-scripts/prestop-redis.sh
@@ -285,6 +289,7 @@ spec:
285289
command: {{- include "common.tplvalues.render" (dict "value" .Values.sentinel.command "context" $) | nindent 12 }}
286290
{{- else }}
287291
command:
292+
- init-stack
288293
- /bin/bash
289294
{{- end }}
290295
{{- if .Values.diagnosticMode.enabled }}
@@ -375,6 +380,7 @@ spec:
375380
failureThreshold: {{ .Values.sentinel.livenessProbe.failureThreshold }}
376381
exec:
377382
command:
383+
- init-stack
378384
- sh
379385
- -c
380386
- /health/ping_sentinel.sh {{ .Values.sentinel.livenessProbe.timeoutSeconds }}
@@ -392,6 +398,7 @@ spec:
392398
failureThreshold: {{ .Values.sentinel.readinessProbe.failureThreshold }}
393399
exec:
394400
command:
401+
- init-stack
395402
- sh
396403
- -c
397404
- /health/ping_sentinel.sh {{ .Values.sentinel.livenessProbe.timeoutSeconds }}
@@ -404,6 +411,7 @@ spec:
404411
preStop:
405412
exec:
406413
command:
414+
- init-stack
407415
- /bin/bash
408416
- -c
409417
- /opt/drycc/scripts/start-scripts/prestop-sentinel.sh
@@ -446,6 +454,7 @@ spec:
446454
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
447455
{{- else }}
448456
command:
457+
- init-stack
449458
- /bin/bash
450459
- -c
451460
- |

addons/redis-1.1.0/chart/redis/values.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ auth:
112112
enabled: true
113113
## @param auth.sentinel Enable password authentication on sentinels too
114114
##
115-
sentinel: false
115+
sentinel: true
116116
## @param auth.password Redis™ password
117117
## Defaults to a random 10-character alphanumeric string if not set
118118
##
@@ -875,7 +875,7 @@ sentinel:
875875
## IMPORTANT: this will disable the master and replicas services and
876876
## create a single Redis™ service exposing both the Redis and Sentinel ports
877877
##
878-
enabled: false
878+
enabled: true
879879
## Bitnami Redis™ Sentinel image version
880880
## ref: https://hub.docker.com/r/bitnami/redis-sentinel/tags/
881881
## @param sentinel.image.registry Redis™ Sentinel image registry
@@ -887,9 +887,9 @@ sentinel:
887887
##
888888
## todo: support both of amd64 and arm64
889889
image:
890-
registry: docker.io
891-
repository: bitnami/redis-sentinel
892-
tag: 6.2.6-debian-10-r176
890+
registry: registry.drycc.cc
891+
repository: drycc-addons/redis-sentinel
892+
tag: 6.2
893893
## Specify a imagePullPolicy
894894
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
895895
## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images
@@ -1026,7 +1026,7 @@ sentinel:
10261026
persistence:
10271027
## @param sentinel.persistence.enabled Enable persistence on Redis™ sentinel nodes using Persistent Volume Claims (Experimental)
10281028
##
1029-
enabled: false
1029+
enabled: true
10301030
## @param sentinel.persistence.storageClass Persistent Volume storage class
10311031
## If defined, storageClassName: <storageClass>
10321032
## If set to "-", storageClassName: "", which disables dynamic provisioning
@@ -1039,7 +1039,7 @@ sentinel:
10391039
- ReadWriteOnce
10401040
## @param sentinel.persistence.size Persistent Volume size
10411041
##
1042-
size: 100Mi
1042+
size: 8Gi
10431043
## @param sentinel.persistence.annotations Additional custom annotations for the PVC
10441044
##
10451045
annotations: {}
@@ -1083,7 +1083,7 @@ sentinel:
10831083
service:
10841084
## @param sentinel.service.type Redis&trade; Sentinel service type
10851085
##
1086-
type: ClusterIP
1086+
type: LoadBalancer
10871087
## @param sentinel.service.ports.redis Redis&trade; service port for Redis&trade;
10881088
## @param sentinel.service.ports.sentinel Redis&trade; service port for Redis&trade; Sentinel
10891089
##

addons/redis-1.1.0/plans/standard-1024/bind.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,23 @@ credential:
3434
name: {{ template "common.names.fullname" . }}
3535
jsonpath: '{ .data.redis-password }'
3636
{{- end }}
37+
38+
{{- if and (eq .Values.architecture "replication") .Values.sentinel.enabled }}
39+
- name: SENTINELHOST
40+
valueFrom:
41+
serviceRef:
42+
name: {{ template "common.names.fullname" . }}
43+
jsonpath: '{ .status.loadBalancer.ingress[*].ip }'
44+
45+
- name: SENTINELPORT
46+
valueFrom:
47+
serviceRef:
48+
name: {{ template "common.names.fullname" . }}
49+
jsonpath: '{ .spec.ports[?(@.name=="tcp-sentinel")].port }'
50+
51+
- name: REDISPORT
52+
valueFrom:
53+
serviceRef:
54+
name: {{ template "common.names.fullname" . }}
55+
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
56+
{{- end }}

addons/redis-1.1.0/plans/standard-1024/values.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,38 @@ replica:
8888
## @param replica.persistence.size Persistent Volume size
8989
##
9090
size: 2Gi
91+
92+
sentinel:
93+
## Persistence parameters
94+
## ref: https://kubernetes.io/docs/user-guide/persistent-volumes/
95+
##
96+
persistence:
97+
## @param sentinel.persistence.enabled Enable persistence on Redis&trade; sentinel nodes using Persistent Volume Claims (Experimental)
98+
##
99+
enabled: true
100+
## @param sentinel.persistence.storageClass Persistent Volume storage class
101+
## If defined, storageClassName: <storageClass>
102+
## If set to "-", storageClassName: "", which disables dynamic provisioning
103+
## If undefined (the default) or set to null, no storageClassName spec is set, choosing the default provisioner
104+
##
105+
storageClass: ""
106+
## @param sentinel.persistence.accessModes Persistent Volume access modes
107+
##
108+
accessModes:
109+
- ReadWriteOnce
110+
## @param sentinel.persistence.size Persistent Volume size
111+
##
112+
size: 2Gi
113+
114+
## Redis&trade; Sentinel resource requests and limits
115+
## ref: https://kubernetes.io/docs/user-guide/compute-resources/
116+
## @param sentinel.resources.limits The resources limits for the Redis&trade; Sentinel containers
117+
## @param sentinel.resources.requests The requested resources for the Redis&trade; Sentinel containers
118+
##
119+
resources:
120+
limits:
121+
cpu: 200m
122+
memory: 1024Mi
123+
requests:
124+
cpu: 20m
125+
memory: 512Mi

addons/redis-1.1.0/plans/standard-128/bind.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,23 @@ credential:
3434
name: {{ template "common.names.fullname" . }}
3535
jsonpath: '{ .data.redis-password }'
3636
{{- end }}
37+
38+
{{- if and (eq .Values.architecture "replication") .Values.sentinel.enabled }}
39+
- name: SENTINELHOST
40+
valueFrom:
41+
serviceRef:
42+
name: {{ template "common.names.fullname" . }}
43+
jsonpath: '{ .status.loadBalancer.ingress[*].ip }'
44+
45+
- name: SENTINELPORT
46+
valueFrom:
47+
serviceRef:
48+
name: {{ template "common.names.fullname" . }}
49+
jsonpath: '{ .spec.ports[?(@.name=="tcp-sentinel")].port }'
50+
51+
- name: REDISPORT
52+
valueFrom:
53+
serviceRef:
54+
name: {{ template "common.names.fullname" . }}
55+
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
56+
{{- end }}

addons/redis-1.1.0/plans/standard-128/values.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,38 @@ replica:
8888
## @param replica.persistence.size Persistent Volume size
8989
##
9090
size: 256Mi
91+
92+
sentinel:
93+
## Persistence parameters
94+
## ref: https://kubernetes.io/docs/user-guide/persistent-volumes/
95+
##
96+
persistence:
97+
## @param sentinel.persistence.enabled Enable persistence on Redis&trade; sentinel nodes using Persistent Volume Claims (Experimental)
98+
##
99+
enabled: true
100+
## @param sentinel.persistence.storageClass Persistent Volume storage class
101+
## If defined, storageClassName: <storageClass>
102+
## If set to "-", storageClassName: "", which disables dynamic provisioning
103+
## If undefined (the default) or set to null, no storageClassName spec is set, choosing the default provisioner
104+
##
105+
storageClass: ""
106+
## @param sentinel.persistence.accessModes Persistent Volume access modes
107+
##
108+
accessModes:
109+
- ReadWriteOnce
110+
## @param sentinel.persistence.size Persistent Volume size
111+
##
112+
size: 256Mi
113+
114+
## Redis&trade; Sentinel resource requests and limits
115+
## ref: https://kubernetes.io/docs/user-guide/compute-resources/
116+
## @param sentinel.resources.limits The resources limits for the Redis&trade; Sentinel containers
117+
## @param sentinel.resources.requests The requested resources for the Redis&trade; Sentinel containers
118+
##
119+
resources:
120+
limits:
121+
cpu: 100m
122+
memory: 128Mi
123+
requests:
124+
cpu: 10m
125+
memory: 64Mi

addons/redis-1.1.0/plans/standard-16384/bind.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,23 @@ credential:
3434
name: {{ template "common.names.fullname" . }}
3535
jsonpath: '{ .data.redis-password }'
3636
{{- end }}
37+
38+
{{- if and (eq .Values.architecture "replication") .Values.sentinel.enabled }}
39+
- name: SENTINELHOST
40+
valueFrom:
41+
serviceRef:
42+
name: {{ template "common.names.fullname" . }}
43+
jsonpath: '{ .status.loadBalancer.ingress[*].ip }'
44+
45+
- name: SENTINELPORT
46+
valueFrom:
47+
serviceRef:
48+
name: {{ template "common.names.fullname" . }}
49+
jsonpath: '{ .spec.ports[?(@.name=="tcp-sentinel")].port }'
50+
51+
- name: REDISPORT
52+
valueFrom:
53+
serviceRef:
54+
name: {{ template "common.names.fullname" . }}
55+
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
56+
{{- end }}

addons/redis-1.1.0/plans/standard-16384/values.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,38 @@ replica:
8787
## @param replica.persistence.size Persistent Volume size
8888
##
8989
size: 32Gi
90+
91+
sentinel:
92+
## Persistence parameters
93+
## ref: https://kubernetes.io/docs/user-guide/persistent-volumes/
94+
##
95+
persistence:
96+
## @param sentinel.persistence.enabled Enable persistence on Redis&trade; sentinel nodes using Persistent Volume Claims (Experimental)
97+
##
98+
enabled: true
99+
## @param sentinel.persistence.storageClass Persistent Volume storage class
100+
## If defined, storageClassName: <storageClass>
101+
## If set to "-", storageClassName: "", which disables dynamic provisioning
102+
## If undefined (the default) or set to null, no storageClassName spec is set, choosing the default provisioner
103+
##
104+
storageClass: ""
105+
## @param sentinel.persistence.accessModes Persistent Volume access modes
106+
##
107+
accessModes:
108+
- ReadWriteOnce
109+
## @param sentinel.persistence.size Persistent Volume size
110+
##
111+
size: 32Gi
112+
113+
## Redis&trade; Sentinel resource requests and limits
114+
## ref: https://kubernetes.io/docs/user-guide/compute-resources/
115+
## @param sentinel.resources.limits The resources limits for the Redis&trade; Sentinel containers
116+
## @param sentinel.resources.requests The requested resources for the Redis&trade; Sentinel containers
117+
##
118+
resources:
119+
limits:
120+
cpu: 1000m
121+
memory: 16Gi
122+
requests:
123+
cpu: 100m
124+
memory: 8Gi

addons/redis-1.1.0/plans/standard-2048/bind.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,23 @@ credential:
3434
name: {{ template "common.names.fullname" . }}
3535
jsonpath: '{ .data.redis-password }'
3636
{{- end }}
37+
38+
{{- if and (eq .Values.architecture "replication") .Values.sentinel.enabled }}
39+
- name: SENTINELHOST
40+
valueFrom:
41+
serviceRef:
42+
name: {{ template "common.names.fullname" . }}
43+
jsonpath: '{ .status.loadBalancer.ingress[*].ip }'
44+
45+
- name: SENTINELPORT
46+
valueFrom:
47+
serviceRef:
48+
name: {{ template "common.names.fullname" . }}
49+
jsonpath: '{ .spec.ports[?(@.name=="tcp-sentinel")].port }'
50+
51+
- name: REDISPORT
52+
valueFrom:
53+
serviceRef:
54+
name: {{ template "common.names.fullname" . }}
55+
jsonpath: '{ .spec.ports[?(@.name=="tcp-redis")].port }'
56+
{{- end }}

addons/redis-1.1.0/plans/standard-2048/values.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,38 @@ replica:
8888
## @param replica.persistence.size Persistent Volume size
8989
##
9090
size: 4Gi
91+
92+
sentinel:
93+
## Persistence parameters
94+
## ref: https://kubernetes.io/docs/user-guide/persistent-volumes/
95+
##
96+
persistence:
97+
## @param sentinel.persistence.enabled Enable persistence on Redis&trade; sentinel nodes using Persistent Volume Claims (Experimental)
98+
##
99+
enabled: true
100+
## @param sentinel.persistence.storageClass Persistent Volume storage class
101+
## If defined, storageClassName: <storageClass>
102+
## If set to "-", storageClassName: "", which disables dynamic provisioning
103+
## If undefined (the default) or set to null, no storageClassName spec is set, choosing the default provisioner
104+
##
105+
storageClass: ""
106+
## @param sentinel.persistence.accessModes Persistent Volume access modes
107+
##
108+
accessModes:
109+
- ReadWriteOnce
110+
## @param sentinel.persistence.size Persistent Volume size
111+
##
112+
size: 4Gi
113+
114+
## Redis&trade; Sentinel resource requests and limits
115+
## ref: https://kubernetes.io/docs/user-guide/compute-resources/
116+
## @param sentinel.resources.limits The resources limits for the Redis&trade; Sentinel containers
117+
## @param sentinel.resources.requests The requested resources for the Redis&trade; Sentinel containers
118+
##
119+
resources:
120+
limits:
121+
cpu: 300m
122+
memory: 2Gi
123+
requests:
124+
cpu: 30m
125+
memory: 1Gi

0 commit comments

Comments
 (0)