Skip to content

Commit 47b46e5

Browse files
committed
fix/workaround: add value alternativeClientCa
Signed-off-by: Vanessa Gaube <dev@vanessagaube.de>
1 parent e0a84af commit 47b46e5

6 files changed

Lines changed: 22 additions & 6 deletions

File tree

valkey/templates/_helpers.tpl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,13 @@ Validate replica authentication configuration
188188
{{- end }}
189189
{{- end -}}
190190

191+
{{/*
192+
Which caFile to use
193+
*/}}
194+
{{- define "valkey.caFile" -}}
195+
{{- if .Values.tls.alternativeClientCa }}
196+
{{- .Values.tls.alternativeClientCa }}
197+
{{- else }}
198+
{{- printf "/tls/%s" .Values.tls.caPublicKey }}
199+
{{- end }}
200+
{{- end -}}

valkey/templates/deploy_valkey.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,14 @@ spec:
115115
startupProbe:
116116
exec:
117117
{{- if .Values.tls.enabled }}
118-
command: [ "sh", "-c", "valkey-cli --cacert /tls/{{ .Values.tls.caPublicKey }} --tls ping" ]
118+
command: [ "sh", "-c", "valkey-cli --cacert {{ include "valkey.caFile" . }} --tls ping" ]
119119
{{- else }}
120120
command: [ "sh", "-c", "valkey-cli ping" ]
121121
{{- end }}
122122
livenessProbe:
123123
exec:
124124
{{- if .Values.tls.enabled }}
125-
command: [ "sh", "-c", "valkey-cli --cacert /tls/{{ .Values.tls.caPublicKey }} --tls ping" ]
125+
command: [ "sh", "-c", "valkey-cli --cacert {{ include "valkey.caFile" . }} --tls ping" ]
126126
{{- else }}
127127
command: [ "sh", "-c", "valkey-cli ping" ]
128128
{{- end }}

valkey/templates/statefulset.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,14 @@ spec:
132132
startupProbe:
133133
exec:
134134
{{- if .Values.tls.enabled }}
135-
command: [ "sh", "-c", "valkey-cli --cacert /tls/{{ .Values.tls.caPublicKey }} --tls ping" ]
135+
command: [ "sh", "-c", "valkey-cli --cacert {{ include "valkey.caFile" . }} --tls ping" ]
136136
{{- else }}
137137
command: [ "sh", "-c", "valkey-cli ping" ]
138138
{{- end }}
139139
livenessProbe:
140140
exec:
141141
{{- if .Values.tls.enabled }}
142-
command: [ "sh", "-c", "valkey-cli --cacert /tls/{{ .Values.tls.caPublicKey }} --tls ping" ]
142+
command: [ "sh", "-c", "valkey-cli --cacert {{ include "valkey.caFile" . }} --tls ping" ]
143143
{{- else }}
144144
command: [ "sh", "-c", "valkey-cli ping" ]
145145
{{- end }}

valkey/templates/tests/auth.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ spec:
3535
3636
{{- if .Values.tls.enabled }}
3737
# TLS flags
38-
TLS_FLAGS="--tls --cacert /tls/{{ .Values.tls.caPublicKey }}"
38+
TLS_FLAGS="--tls --cacert {{ include "valkey.caFile" . }}"
3939
{{- else }}
4040
TLS_FLAGS=""
4141
{{- end }}
@@ -107,7 +107,7 @@ spec:
107107
108108
{{- if .Values.tls.enabled }}
109109
# TLS flags
110-
TLS_FLAGS="--tls --cacert /tls/{{ .Values.tls.caPublicKey }}"
110+
TLS_FLAGS="--tls --cacert {{ include "valkey.caFile" . }}"
111111
{{- else }}
112112
TLS_FLAGS=""
113113
{{- end }}

valkey/values.schema.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,9 @@
519519
"caPublicKey": {
520520
"type": "string"
521521
},
522+
"alternativeClientCa": {
523+
"type": "string"
524+
},
522525
"dhParamKey": {
523526
"type": "string"
524527
},

valkey/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,9 @@ tls:
269269
serverKey: server.key
270270
# Secret key name containing Certificate Authority public certificate
271271
caPublicKey: ca.crt
272+
# 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.
273+
# Useful e.g. for trust-manager in combination with cert-manager-generated ACME certs.
274+
alternativeClientCa: ""
272275
# Secret key name containing DH parameters (optional)
273276
dhParamKey: ""
274277
# Require that clients authenticate with a certificate

0 commit comments

Comments
 (0)