Skip to content

Commit

Permalink
feat: add PDB and probes, drop unspecified acl in sentinel helm (#1123)
Browse files Browse the repository at this point in the history
Signed-off-by: Dariusch Ochlast <[email protected]>
  • Loading branch information
Dariusch authored Nov 8, 2024
1 parent d043326 commit efb9624
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 12 deletions.
14 changes: 13 additions & 1 deletion charts/redis-sentinel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ helm delete <my-release> --namespace <namespace>
| TLS.cert | string | `"tls.crt"` | |
| TLS.key | string | `"tls.key"` | |
| TLS.secret.secretName | string | `""` | |
| acl.secret.secretName | string | `""` | |
| affinity | object | `{}` | |
| env | list | `[]` | |
| externalConfig.data | string | `"tcp-keepalive 400\nslowlog-max-len 158\nstream-node-max-bytes 2048\n"` | |
Expand All @@ -64,10 +63,23 @@ helm delete <my-release> --namespace <namespace>
| initContainer.imagePullPolicy | string | `"IfNotPresent"` | |
| initContainer.resources | object | `{}` | |
| labels | object | `{}` | |
| livenessProbe.failureThreshold | int | `3` | |
| livenessProbe.initialDelaySeconds | int | `1` | |
| livenessProbe.periodSeconds | int | `10` | |
| livenessProbe.successThreshold | int | `1` | |
| livenessProbe.timeoutSeconds | int | `1` | |
| nodeSelector | object | `{}` | |
| pdb.enabled | bool | `false` | |
| pdb.maxUnavailable | string | `nil` | |
| pdb.minAvailable | int | `1` | |
| podSecurityContext.fsGroup | int | `1000` | |
| podSecurityContext.runAsUser | int | `1000` | |
| priorityClassName | string | `""` | |
| readinessProbe.failureThreshold | int | `3` | |
| readinessProbe.initialDelaySeconds | int | `1` | |
| readinessProbe.periodSeconds | int | `10` | |
| readinessProbe.successThreshold | int | `1` | |
| readinessProbe.timeoutSeconds | int | `1` | |
| redisExporter.enabled | bool | `false` | |
| redisExporter.env | list | `[]` | |
| redisExporter.image | string | `"quay.io/opstree/redis-exporter"` | |
Expand Down
23 changes: 16 additions & 7 deletions charts/redis-sentinel/templates/redis-sentinel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
labels: {{- include "common.labels" . | nindent 4 }}
spec:
clusterSize: {{ .Values.redisSentinel.clusterSize }}
# Sentinel Config
# Sentinel Config
redisSentinelConfig:
redisReplicationName: {{ .Values.redisSentinelConfig.redisReplicationName}}
{{- if and .Values.redisSentinelConfig.redisReplicationPassword.secretName .Values.redisSentinelConfig.redisReplicationPassword.secretKey }}
Expand Down Expand Up @@ -52,11 +52,11 @@ spec:
imagePullPolicy: "{{ .Values.redisExporter.imagePullPolicy }}"
{{- if .Values.redisExporter.resources}}
resources: {{ toYaml .Values.redisExporter.resources | nindent 6 }}
{{- end }}
{{- end }}
{{- if .Values.redisExporter.env }}
env: {{ toYaml .Values.redisExporter.env | nindent 6 }}
{{- end }}

{{- if .Values.nodeSelector }}
nodeSelector: {{ toYaml .Values.nodeSelector | nindent 4 }}
{{- end }}
Expand All @@ -83,10 +83,19 @@ spec:
secret:
secretName: {{ .Values.TLS.secret.secretName | quote }}
{{- end }}
{{- if and .Values.acl.secret (ne .Values.acl.secret.secretName "") }}
acl:
secret:
secretName: {{ .Values.acl.secret.secretName | quote }}
{{- if .Values.pdb.enabled }}
pdb:
enabled: {{ .enabled }}
minAvailable: {{ .minAvailable }}
maxUnavailable: {{ .maxUnavailable }}
{{- end }}
{{- with .Values.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if and .Values.initContainer .Values.initContainer.enabled (ne .Values.initContainer.image "") }}
initContainer: {{ include "initContainer.properties" | nindent 4 }}
Expand Down
23 changes: 19 additions & 4 deletions charts/redis-sentinel/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ redisSentinel:
ignoreAnnotations: []
# - "redis.opstreelabs.in/ignore"
minReadySeconds: 0

# Overwite name for resources
# name: ""

Expand Down Expand Up @@ -143,9 +143,24 @@ TLS:
secret:
secretName: ""

acl:
secret:
secretName: ""
pdb:
enabled: false
minAvailable: 1
maxUnavailable: null

livenessProbe:
failureThreshold: 3
initialDelaySeconds: 1
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1

readinessProbe:
failureThreshold: 3
initialDelaySeconds: 1
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1

env: []
# - name: VAR_NAME
Expand Down

0 comments on commit efb9624

Please sign in to comment.