feat(node): support for name replacement
Some checks failed
Build and Push Image / Build and push image (push) Failing after 13s

now when you include this project you can change then service and statefulset name from
the valkey-env configMap
This commit is contained in:
2025-05-28 10:57:50 +02:00
parent 36e6cd84f9
commit 3c550b3015
6 changed files with 59 additions and 166 deletions

View File

@ -2,6 +2,7 @@
{{- $service := env "VALKEY_SERVICE" }}
{{- $namespace := env "NAMESPACE" }}
{{- $port := env "VALKEY_PORT" }}
{{- $name := env "VALKEY_NAME" }}
{{- $sentinel_port := env "VALKEY_SENTINEL_PORT" }}
{{- $replicas := env "VALKEY_REPLICAS" }}
{{- $domain := printf "%s.%s.svc.cluster.local" $service $namespace }}
@ -36,7 +37,7 @@ sentinel leader-epoch mymaster 0
sentinel current-epoch 0
{{- range $i, $e := until ( int $replicas ) }}
{{- $ndeHostname := printf "valkey-node-%d" $i }}
{{- $ndeHostname := printf "%s-%d" $name $i }}
{{- $ndeFQDN := printf "%s.%s" $ndeHostname $domain }}
{{- $nodeID := sha1sum $ndeHostname }}
{{- if (ne $fqdn $ndeFQDN) }}