diff --git a/resources/node/files/conf/replication.conf.tpl b/components/node/files/conf/replication.conf.tpl similarity index 100% rename from resources/node/files/conf/replication.conf.tpl rename to components/node/files/conf/replication.conf.tpl diff --git a/resources/node/files/conf/replication.conf.tpl.full b/components/node/files/conf/replication.conf.tpl.full similarity index 100% rename from resources/node/files/conf/replication.conf.tpl.full rename to components/node/files/conf/replication.conf.tpl.full diff --git a/resources/node/files/conf/sentinel.conf.tpl b/components/node/files/conf/sentinel.conf.tpl similarity index 71% rename from resources/node/files/conf/sentinel.conf.tpl rename to components/node/files/conf/sentinel.conf.tpl index fcc6aff..113114e 100644 --- a/resources/node/files/conf/sentinel.conf.tpl +++ b/components/node/files/conf/sentinel.conf.tpl @@ -9,12 +9,13 @@ {{- $fqdn := printf "%s.%s" $hostname $domain }} {{- $hostid := sha1sum $hostname }} {{- $quorum := env "VALKEY_QUORUM" }} +{{- $master_name := env "VALKEY_MASTER_NAME" }} #-REPLICAS:{{ $replicas }} dir "/tmp" port {{ $sentinel_port }} -sentinel monitor mymaster SENTINEL_MASTER {{ $port }} {{ $quorum }} -sentinel down-after-milliseconds mymaster 60000 +sentinel monitor {{ $master_name }} SENTINEL_MASTER {{ $port }} {{ $quorum }} +sentinel down-after-milliseconds {{ $master_name }} 60000 # User-supplied sentinel configuration: # End of sentinel configuration @@ -32,16 +33,17 @@ protected-mode no # gotemplate-pause! user default on nopass sanitize-payload ~* &* +@all # gotemplate-resume! -sentinel config-epoch mymaster 0 -sentinel leader-epoch mymaster 0 +sentinel config-epoch {{ $master_name }} 0 +sentinel leader-epoch {{ $master_name }} 0 sentinel current-epoch 0 {{- range $i, $e := until ( int $replicas ) }} + {{- $masterName := printf "%s" $master_name}} {{- $ndeHostname := printf "%s-%d" $name $i }} {{- $ndeFQDN := printf "%s.%s" $ndeHostname $domain }} {{- $nodeID := sha1sum $ndeHostname }} {{- if (ne $fqdn $ndeFQDN) }} -sentinel {{ printf "known-sentinel mymaster %s %s %s" $ndeFQDN $sentinel_port $nodeID }} -sentinel {{ printf "known-replica mymaster %s %s" $ndeFQDN $port }} +sentinel {{ printf "known-sentinel %s %s %s %s" $masterName $ndeFQDN $sentinel_port $nodeID }} +sentinel {{ printf "known-replica %s %s %s" $masterName $ndeFQDN $port }} {{- end}} {{- end}} \ No newline at end of file diff --git a/resources/node/files/scripts/common.sh b/components/node/files/scripts/common.sh similarity index 68% rename from resources/node/files/scripts/common.sh rename to components/node/files/scripts/common.sh index 391b885..feb0923 100644 --- a/resources/node/files/scripts/common.sh +++ b/components/node/files/scripts/common.sh @@ -15,8 +15,30 @@ pingSentinel() { } getPrimaryInfo() { - valkey-cli --csv -h ${VALKEY_HEADLESS_SERVICE} -p ${VALKEY_SENTINEL_PORT} sentinel get-primary-addr-by-name "mymaster"| \ - awk -F ',' '{ gsub(/"/,"",$0); print $1 " " $2 }' + masterName=${VALKEY_MASTER_NAME:-"mymaster"} + it="${1:-0}" + + info=$(valkey-cli --csv -h ${VALKEY_HEADLESS_SERVICE} -p ${VALKEY_SENTINEL_PORT} sentinel get-primary-addr-by-name "${masterName}"| \ + awk -F ',' '{ gsub(/"/,"",$0); print $1 " " $2 }') + + if [ -z "${info}" ]; then + echo "Failed to get primary info for master '${masterName}'" + it=$((it + 1)) + getPrimaryInfo ${it} + if [ ${it} -ge 10 ]; then + echo "Failed to get primary info after 5 attempts" + return 1 + fi + fi + if [[ "${info}" =~ /^NULL/ ]]; then + it=$((it + 1)) + getPrimaryInfo ${it} + if [ ${it} -ge 10 ]; then + echo "Failed to get primary info after 5 attempts" + return 1 + fi + fi + echo "${info}" return ${?} } diff --git a/resources/node/files/scripts/liveness-local.sh b/components/node/files/scripts/liveness-local.sh similarity index 100% rename from resources/node/files/scripts/liveness-local.sh rename to components/node/files/scripts/liveness-local.sh diff --git a/resources/node/files/scripts/ping-sentinel.sh b/components/node/files/scripts/ping-sentinel.sh similarity index 100% rename from resources/node/files/scripts/ping-sentinel.sh rename to components/node/files/scripts/ping-sentinel.sh diff --git a/resources/node/files/scripts/pre-stop-sentinel.sh b/components/node/files/scripts/pre-stop-sentinel.sh similarity index 100% rename from resources/node/files/scripts/pre-stop-sentinel.sh rename to components/node/files/scripts/pre-stop-sentinel.sh diff --git a/resources/node/files/scripts/pre-stop.sh b/components/node/files/scripts/pre-stop.sh similarity index 87% rename from resources/node/files/scripts/pre-stop.sh rename to components/node/files/scripts/pre-stop.sh index 2bbc799..58e373e 100644 --- a/resources/node/files/scripts/pre-stop.sh +++ b/components/node/files/scripts/pre-stop.sh @@ -15,7 +15,8 @@ vcli-sentinel() { getFailOverStatus() { # Check if the failover is finished local failoverStatus - primaryInfo=$(vcli-sentinel get-primary-addr-by-name "mymaster") + sentinelMasterName="${VALKEY_MASTER_NAME:-"mymaster"}" + primaryInfo=$(vcli-sentinel get-primary-addr-by-name "${sentinelMasterName}") primaryHost=$(echo ${primaryInfo} | awk -F ' ' '{print $1}') currentHost=$(hostname -f) if [[ "${primaryHost}" != "${currentHost}" ]]; then @@ -44,12 +45,13 @@ isPrimary() { } if isPrimary && ! getFailOverStatus; then + sentinelMasterName="${VALKEY_MASTER_NAME}" echo "I'm the primary and you are stopping me, pausing client connections" #Pausing write connections to avoid data loss" vcli CLIENT PAUSE "22000" WRITE echo "Starting failover" - vcli-sentinel failover "mymaster" + vcli-sentinel failover "${sentinelMasterName}" echo "Waiting for sentinel to complete failover for up to 120s" tmout=120 while true ; do diff --git a/resources/node/files/scripts/readiness-local.sh b/components/node/files/scripts/readiness-local.sh similarity index 100% rename from resources/node/files/scripts/readiness-local.sh rename to components/node/files/scripts/readiness-local.sh diff --git a/resources/node/files/scripts/start-node.sh b/components/node/files/scripts/start-node.sh similarity index 82% rename from resources/node/files/scripts/start-node.sh rename to components/node/files/scripts/start-node.sh index 10dc695..57d3837 100644 --- a/resources/node/files/scripts/start-node.sh +++ b/components/node/files/scripts/start-node.sh @@ -12,7 +12,8 @@ pingSentinel() { } getPrimaryInfo() { - valkey-cli -t 15 --csv -h ${VALKEY_HEADLESS_SERVICE} -p ${VALKEY_SENTINEL_PORT} sentinel get-primary-addr-by-name "mymaster"| \ + sentinelMasterName="${VALKEY_MASTER_NAME:-"mymaster"}" + valkey-cli -t 15 --csv -h ${VALKEY_HEADLESS_SERVICE} -p ${VALKEY_SENTINEL_PORT} sentinel get-primary-addr-by-name "${sentinelMasterName}"| \ awk -F ',' '{ gsub(/"/,"",$0); print $1 " " $2 }' return ${?} } @@ -80,12 +81,17 @@ else echo "Primary host is : ${primaryHost}, port: ${primaryPort}" currentHost=$(hostname -f) echo "Current host is : ${currentHost}" - if [ "${primaryHost}" != "${currentHost}" ]; then - echo "Not the primary, setting up as replica" - startPrimary=0 - else - echo "This is the primary" + if [ "${primaryHost}" = "NULL" ]; then + echo "Not primary yet, starting as primary" startPrimary=1 + else + if [ "${primaryHost}" != "${currentHost}" ]; then + echo "Not the primary, setting up as replica" + startPrimary=0 + else + echo "This is the primary" + startPrimary=1 + fi fi fi diff --git a/resources/node/files/scripts/startSentinel.sh b/components/node/files/scripts/startSentinel.sh similarity index 100% rename from resources/node/files/scripts/startSentinel.sh rename to components/node/files/scripts/startSentinel.sh diff --git a/components/node/kustomization.yaml b/components/node/kustomization.yaml new file mode 100644 index 0000000..3314971 --- /dev/null +++ b/components/node/kustomization.yaml @@ -0,0 +1,44 @@ +apiVersion: kustomize.config.k8s.io/v1alpha1 +kind: Component + +resources: +- resources/sa.yaml +- resources/statefulset.yaml +- resources/svc.yaml + +configMapGenerator: +#- name: valkey-env +# literals: +# - NAMESPACE="default" +# - VALKEY_ENV="base" +# - VALKEY_NAME="valkey-node" +# - VALKEY_SERVICE="valkey-node" +# - VALKEY_HEADLESS_SERVICE="valkey-node-headless" +# - VALKEY_MASTER_NAME="mymaster" +# - VALKEY_REPLICAS="4" +# - VALKEY_PORT="6379" +# - VALKEY_SENTINEL_PORT="26379" +# - ALLOW_EMPTY_PASSWORD="yes" +# - VALKEY_TLS_ENABLED="no" +# - VALKEY_SENTINEL_TLS_ENABLED="no" +# - VALKEY_DATA_DIR="/data" +# - VALKEY_LOG_LEVEL="warning" +# - VALKEY_QUORUM="2" +- name: valkey-config + files: + - files/conf/replication.conf.tpl + - files/conf/sentinel.conf.tpl +- name: valkey-scripts + files: + - files/scripts/common.sh + - files/scripts/startSentinel.sh + - files/scripts/pre-stop.sh + - files/scripts/pre-stop-sentinel.sh + - files/scripts/start-node.sh + - files/scripts/ping-sentinel.sh + - files/scripts/liveness-local.sh + - files/scripts/readiness-local.sh + +replacements: +- path: replacements/service.yaml +- path: replacements/statefulset.yaml diff --git a/components/node/replacements/service.yaml b/components/node/replacements/service.yaml new file mode 100644 index 0000000..7387c1e --- /dev/null +++ b/components/node/replacements/service.yaml @@ -0,0 +1,17 @@ +- source: + kind: ConfigMap + name: valkey-env + fieldPath: data.VALKEY_SERVICE + targets: + - select: + kind: Service + name: valkey-headless + fieldPaths: + - metadata.labels.app + - spec.selector.app + - select: + kind: Service + name: valkey + fieldPaths: + - metadata.labels.app + - spec.selector.app diff --git a/components/node/replacements/statefulset.yaml b/components/node/replacements/statefulset.yaml new file mode 100644 index 0000000..9274624 --- /dev/null +++ b/components/node/replacements/statefulset.yaml @@ -0,0 +1,12 @@ +- source: + kind: ConfigMap + name: valkey-env + fieldPath: data.VALKEY_SERVICE + targets: + - select: + kind: StatefulSet + name: valkey-node + fieldPaths: + - metadata.labels.app + - spec.selector.matchLabels.app + - spec.template.metadata.labels.app diff --git a/resources/node/resources/sa.yaml b/components/node/resources/sa.yaml similarity index 100% rename from resources/node/resources/sa.yaml rename to components/node/resources/sa.yaml diff --git a/resources/node/resources/statefulset.yaml b/components/node/resources/statefulset.yaml similarity index 95% rename from resources/node/resources/statefulset.yaml rename to components/node/resources/statefulset.yaml index fcbae0b..281b64b 100644 --- a/resources/node/resources/statefulset.yaml +++ b/components/node/resources/statefulset.yaml @@ -2,12 +2,13 @@ apiVersion: apps/v1 kind: StatefulSet metadata: labels: + app: CHANGE_ME app.kubernetes.io/component: node app.kubernetes.io/instance: valkey app.kubernetes.io/managed-by: kustomize app.kubernetes.io/name: valkey app.kubernetes.io/part-of: valkey - app.kubernetes.io/version: 8.1.1 + app.kubernetes.io/version: 8.1.3 name: valkey-node spec: persistentVolumeClaimRetentionPolicy: @@ -23,17 +24,19 @@ spec: app.kubernetes.io/component: node app.kubernetes.io/instance: valkey app.kubernetes.io/name: valkey + app: CHANGE_ME serviceName: valkey-headless updateStrategy: type: RollingUpdate template: metadata: labels: + app: CHANGE_ME app.kubernetes.io/component: node app.kubernetes.io/instance: valkey app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: valkey - app.kubernetes.io/version: 8.1.1 + app.kubernetes.io/version: 8.1.3 helm.sh/chart: valkey-3.0.7 spec: shareProcessNamespace: true @@ -107,7 +110,7 @@ spec: name: valkey-data containers: - name: valkey - image: reg.cadoles.com/dh/valkey/valkey:8.1.1-alpine3.21 + image: reg.cadoles.com/dh/valkey/valkey:8.1.3-alpine3.22 command: - /opt/scripts/start-node.sh args: @@ -194,7 +197,7 @@ spec: - mountPath: /data name: valkey-data - name: sentinel - image: reg.cadoles.com/dh/valkey/valkey:8.1.1-alpine3.21 + image: reg.cadoles.com/dh/valkey/valkey:8.1.3-alpine3.22 imagePullPolicy: IfNotPresent command: - /opt/scripts/startSentinel.sh @@ -288,8 +291,8 @@ spec: runAsGroup: 1001 fsGroup: 1001 fsGroupChangePolicy: Always - serviceAccount: valkey - serviceAccountName: valkey + #serviceAccount: valkey + #serviceAccountName: valkey terminationGracePeriodSeconds: 30 volumes: - name: valkey-scripts @@ -320,9 +323,6 @@ spec: resources: requests: storage: 8Gi - volumeMode: Filesystem - status: - phase: Pending - apiVersion: v1 kind: PersistentVolumeClaim metadata: @@ -338,6 +338,3 @@ spec: resources: requests: storage: 32Mi - volumeMode: Filesystem - status: - phase: Pending diff --git a/resources/node/resources/svc.yaml b/components/node/resources/svc.yaml similarity index 90% rename from resources/node/resources/svc.yaml rename to components/node/resources/svc.yaml index 6c0b102..53ec321 100644 --- a/resources/node/resources/svc.yaml +++ b/components/node/resources/svc.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: Service metadata: labels: + app: CHANGE_ME app.kubernetes.io/component: node app.kubernetes.io/instance: valkey app.kubernetes.io/managed-by: kustomize @@ -20,6 +21,7 @@ spec: protocol: TCP targetPort: 26379 selector: + app: CHANGE_ME app.kubernetes.io/component: node app.kubernetes.io/instance: valkey app.kubernetes.io/name: valkey @@ -28,10 +30,11 @@ apiVersion: v1 kind: Service metadata: labels: + app: CHANGE_ME app.kubernetes.io/component: node app.kubernetes.io/instance: valkey app.kubernetes.io/managed-by: kustomize - app.kubernetes.io/name: valkey + app.kubernetes.io/name: valkey-headless app.kubernetes.io/part-of: valkey app.kubernetes.io/version: 8.1.1 name: valkey-headless @@ -48,5 +51,6 @@ spec: targetPort: valkey-sentinel publishNotReadyAddresses: true selector: + app: CHANGE_ME app.kubernetes.io/instance: valkey app.kubernetes.io/name: valkey diff --git a/kustomization.yaml b/kustomization.yaml index ad68128..35e1765 100644 --- a/kustomization.yaml +++ b/kustomization.yaml @@ -1,5 +1,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -resources: +components: - resources/node diff --git a/misc/docker/Dockerfile b/misc/docker/Dockerfile index ad67f69..c880761 100644 --- a/misc/docker/Dockerfile +++ b/misc/docker/Dockerfile @@ -1,5 +1,5 @@ # Base image -FROM golang:tip-alpine3.21 AS builder +FROM golang:tip-alpine3.22 AS builder # Set directory to known value WORKDIR /app @@ -14,7 +14,7 @@ RUN git clone https://github.com/coveooss/gotemplate.git . && \ CGO_ENABLED=0 go build -FROM alpine:3.21 +FROM alpine:3.22 # COPY --from=builder /app/gotemplate /gotemplate COPY --from=builder /usr/bin/valkey-cli /valkey-cli diff --git a/misc/tests/kustomization.yaml b/misc/tests/kustomization.yaml new file mode 100644 index 0000000..abfb210 --- /dev/null +++ b/misc/tests/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: +- resources/namespace.yaml +- resources/vlone +- resources/vltwo diff --git a/misc/tests/resources/namespace.yaml b/misc/tests/resources/namespace.yaml new file mode 100644 index 0000000..80cda30 --- /dev/null +++ b/misc/tests/resources/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: vltest diff --git a/misc/tests/resources/vlone/kustomization.yaml b/misc/tests/resources/vlone/kustomization.yaml new file mode 100644 index 0000000..d54490e --- /dev/null +++ b/misc/tests/resources/vlone/kustomization.yaml @@ -0,0 +1,25 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namePrefix: vlone- + +components: +- https://forge.cadoles.com/CadolesKube/valkey-kustom//components/node + +configMapGenerator: +- name: valkey-env + literals: + - NAMESPACE="vltest" + - VALKEY_ENV="vltest" + - VALKEY_NAME="vlone-valkey-node" + - VALKEY_SERVICE="vlone-valkey" + - VALKEY_HEADLESS_SERVICE="vlone-valkey-headless" + - VALKEY_MASTER_NAME="mymaster" + - VALKEY_REPLICAS="6" + - VALKEY_PORT="6379" + - VALKEY_SENTINEL_PORT="26379" + - ALLOW_EMPTY_PASSWORD="yes" + - VALKEY_TLS_ENABLED="no" + - VALKEY_SENTINEL_TLS_ENABLED="no" + - VALKEY_DATA_DIR="/data" + - VALKEY_LOG_LEVEL="warning" + - VALKEY_QUORUM="2" diff --git a/resources/node/replacements/services.yaml b/misc/tests/resources/vlone/replacements/services.yaml similarity index 89% rename from resources/node/replacements/services.yaml rename to misc/tests/resources/vlone/replacements/services.yaml index d325149..62f4229 100644 --- a/resources/node/replacements/services.yaml +++ b/misc/tests/resources/vlone/replacements/services.yaml @@ -1,6 +1,6 @@ - source: kind: ConfigMap - name: valkey-env + name: vlone fieldPath: data.VALKEY_HEADLESS_SERVICE targets: - select: @@ -10,7 +10,7 @@ - metadata.name - source: kind: ConfigMap - name: valkey-env + name: vlone fieldPath: data.VALKEY_SERVICE targets: - select: diff --git a/misc/tests/resources/vlone/replacements/statefulset.yaml b/misc/tests/resources/vlone/replacements/statefulset.yaml new file mode 100644 index 0000000..edc9412 --- /dev/null +++ b/misc/tests/resources/vlone/replacements/statefulset.yaml @@ -0,0 +1,31 @@ +- source: + kind: ConfigMap + name: vlone + fieldPath: data.VALKEY_NAME + targets: + - select: + kind: StatefulSet + name: valkey-node + fieldPaths: + - metadata.name +- source: + kind: ConfigMap + name: vlone + fieldPath: data.VALKEY_ENV_NAME + targets: + - select: + kind: StatefulSet + name: valkey-node + fieldPaths: + - spec.template.spec.containers[*].envFrom[0].configMapRef.name + - spec.template.spec.initContainers[*].envFrom[0].configMapRef.name +- source: + kind: ConfigMap + name: vlone + fieldPath: data.VALKEY_CONF_NAME + targets: + - select: + kind: StatefulSet + name: valkey-node + fieldPaths: + - spec.template.spec.initContainers[*].volumeMounts[valkey-config].name diff --git a/misc/tests/resources/vltwo/kustomization.yaml b/misc/tests/resources/vltwo/kustomization.yaml new file mode 100644 index 0000000..23f645e --- /dev/null +++ b/misc/tests/resources/vltwo/kustomization.yaml @@ -0,0 +1,25 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namePrefix: vltwo- + +components: +- https://forge.cadoles.com/CadolesKube/valkey-kustom//components/node + +configMapGenerator: +- name: valkey-env + literals: + - NAMESPACE="vltest" + - VALKEY_ENV="vltest" + - VALKEY_NAME="vltwo-valkey-node" + - VALKEY_SERVICE="vltwo-valkey" + - VALKEY_HEADLESS_SERVICE="vltwo-valkey-headless" + - VALKEY_MASTER_NAME="vltwomaster" + - VALKEY_REPLICAS="4" + - VALKEY_PORT="6379" + - VALKEY_SENTINEL_PORT="26379" + - ALLOW_EMPTY_PASSWORD="yes" + - VALKEY_TLS_ENABLED="no" + - VALKEY_SENTINEL_TLS_ENABLED="no" + - VALKEY_DATA_DIR="/data" + - VALKEY_LOG_LEVEL="warning" + - VALKEY_QUORUM="2" diff --git a/misc/tests/resources/vltwo/replacements/services.yaml b/misc/tests/resources/vltwo/replacements/services.yaml new file mode 100644 index 0000000..3e2137e --- /dev/null +++ b/misc/tests/resources/vltwo/replacements/services.yaml @@ -0,0 +1,20 @@ +- source: + kind: ConfigMap + name: vltwo + fieldPath: data.VALKEY_HEADLESS_SERVICE + targets: + - select: + kind: Service + name: valkey-headless + fieldPaths: + - metadata.name +- source: + kind: ConfigMap + name: vltwo + fieldPath: data.VALKEY_SERVICE + targets: + - select: + kind: Service + name: valkey + fieldPaths: + - metadata.name diff --git a/misc/tests/resources/vltwo/replacements/statefulset.yaml b/misc/tests/resources/vltwo/replacements/statefulset.yaml new file mode 100644 index 0000000..fb5ee88 --- /dev/null +++ b/misc/tests/resources/vltwo/replacements/statefulset.yaml @@ -0,0 +1,31 @@ +- source: + kind: ConfigMap + name: vltwo + fieldPath: data.VALKEY_NAME + targets: + - select: + kind: StatefulSet + name: valkey-node + fieldPaths: + - metadata.name +- source: + kind: ConfigMap + name: vltwo + fieldPath: data.VALKEY_ENV_NAME + targets: + - select: + kind: StatefulSet + name: valkey-node + fieldPaths: + - spec.template.spec.containers[*].envFrom[0].configMapRef.name + - spec.template.spec.initContainers[*].envFrom[0].configMapRef.name +- source: + kind: ConfigMap + name: vltwo + fieldPath: data.VALKEY_CONF_NAME + targets: + - select: + kind: StatefulSet + name: valkey-node + fieldPaths: + - spec.template.spec.initContainers[*].volumeMounts[valkey-config].name diff --git a/resources/node/kustomization.yaml b/resources/node/kustomization.yaml deleted file mode 100644 index bec987a..0000000 --- a/resources/node/kustomization.yaml +++ /dev/null @@ -1,43 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -resources: -- resources/sa.yaml -- resources/statefulset.yaml -- resources/svc.yaml - -configMapGenerator: -- name: valkey-env - literals: - - NAMESPACE="default" - - VALKEY_ENV="base" - - VALKEY_NAME="valkey-node" - - VALKEY_SERVICE="valkey-node" - - VALKEY_HEADLESS_SERVICE="valkey-node-headless" - - VALKEY_REPLICAS="4" - - VALKEY_PORT="6379" - - VALKEY_SENTINEL_PORT="26379" - - ALLOW_EMPTY_PASSWORD="yes" - - VALKEY_TLS_ENABLED="no" - - VALKEY_SENTINEL_TLS_ENABLED="no" - - VALKEY_DATA_DIR="/data" - - VALKEY_LOG_LEVEL="warning" - - VALKEY_QUORUM="2" -- name: valkey-config - files: - - files/conf/replication.conf.tpl - - files/conf/sentinel.conf.tpl -- name: valkey-scripts - files: - - files/scripts/common.sh - - files/scripts/startSentinel.sh - - files/scripts/pre-stop.sh - - files/scripts/pre-stop-sentinel.sh - - files/scripts/start-node.sh - - files/scripts/ping-sentinel.sh - - files/scripts/liveness-local.sh - - files/scripts/readiness-local.sh - -#replacements: -#- path: ./replacements/services.yaml -#- path: ./replacements/statefulset.yaml diff --git a/resources/node/replacements/statefulset.yaml b/resources/node/replacements/statefulset.yaml deleted file mode 100644 index 4f82603..0000000 --- a/resources/node/replacements/statefulset.yaml +++ /dev/null @@ -1,20 +0,0 @@ -- source: - kind: ConfigMap - name: valkey-env - fieldPath: data.VALKEY_REPLICAS - targets: - - select: - kind: StatefulSet - name: valkey-node - fieldPaths: - - spec.replicas -- source: - kind: ConfigMap - name: valkey-env - fieldPath: data.VALKEY_HEADLESS_SERVICE - targets: - - select: - kind: StatefulSet - name: valkey-node - fieldPaths: - - spec.serviceName