Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions valkey/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,13 @@ Validate replica authentication configuration
{{- end }}
{{- end -}}

{{/*
Which caFile to use
*/}}
{{- define "valkey.caFile" -}}
{{- if .Values.tls.alternativeClientCa }}
{{- .Values.tls.alternativeClientCa }}
{{- else }}
{{- printf "/tls/%s" .Values.tls.caPublicKey }}
{{- end }}
{{- end -}}
4 changes: 2 additions & 2 deletions valkey/templates/deploy_valkey.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ spec:
startupProbe:
exec:
{{- if .Values.tls.enabled }}
command: [ "sh", "-c", "valkey-cli --cacert /tls/{{ .Values.tls.caPublicKey }} --tls ping" ]
command: [ "sh", "-c", "valkey-cli --cacert {{ include "valkey.caFile" . }} --tls ping" ]
{{- else }}
command: [ "sh", "-c", "valkey-cli ping" ]
{{- end }}
livenessProbe:
exec:
{{- if .Values.tls.enabled }}
command: [ "sh", "-c", "valkey-cli --cacert /tls/{{ .Values.tls.caPublicKey }} --tls ping" ]
command: [ "sh", "-c", "valkey-cli --cacert {{ include "valkey.caFile" . }} --tls ping" ]
{{- else }}
command: [ "sh", "-c", "valkey-cli ping" ]
{{- end }}
Expand Down
4 changes: 2 additions & 2 deletions valkey/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ spec:
startupProbe:
exec:
{{- if .Values.tls.enabled }}
command: [ "sh", "-c", "valkey-cli --cacert /tls/{{ .Values.tls.caPublicKey }} --tls ping" ]
command: [ "sh", "-c", "valkey-cli --cacert {{ include "valkey.caFile" . }} --tls ping" ]
{{- else }}
command: [ "sh", "-c", "valkey-cli ping" ]
{{- end }}
livenessProbe:
exec:
{{- if .Values.tls.enabled }}
command: [ "sh", "-c", "valkey-cli --cacert /tls/{{ .Values.tls.caPublicKey }} --tls ping" ]
command: [ "sh", "-c", "valkey-cli --cacert {{ include "valkey.caFile" . }} --tls ping" ]
{{- else }}
command: [ "sh", "-c", "valkey-cli ping" ]
{{- end }}
Expand Down
4 changes: 2 additions & 2 deletions valkey/templates/tests/auth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:

{{- if .Values.tls.enabled }}
# TLS flags
TLS_FLAGS="--tls --cacert /tls/{{ .Values.tls.caPublicKey }}"
TLS_FLAGS="--tls --cacert {{ include "valkey.caFile" . }}"
{{- else }}
TLS_FLAGS=""
{{- end }}
Expand Down Expand Up @@ -107,7 +107,7 @@ spec:

{{- if .Values.tls.enabled }}
# TLS flags
TLS_FLAGS="--tls --cacert /tls/{{ .Values.tls.caPublicKey }}"
TLS_FLAGS="--tls --cacert {{ include "valkey.caFile" . }}"
{{- else }}
TLS_FLAGS=""
{{- end }}
Expand Down
3 changes: 3 additions & 0 deletions valkey/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,9 @@
"caPublicKey": {
"type": "string"
},
"alternativeClientCa": {
"type": "string"
},
"dhParamKey": {
"type": "string"
},
Expand Down
3 changes: 3 additions & 0 deletions valkey/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ tls:
serverKey: server.key
# Secret key name containing Certificate Authority public certificate
caPublicKey: ca.crt
# in case the caPublicKey does not work for the client (e.g. valkey-cli), you can set an alternative CA cert as an absolute path here.
# Useful e.g. for trust-manager in combination with cert-manager-generated ACME certs.
alternativeClientCa: ""
# Secret key name containing DH parameters (optional)
dhParamKey: ""
# Require that clients authenticate with a certificate
Expand Down