valkey-cluster

by stand-sure

Helm chartv1.1.0App 8.0.1Apache-2.0Verified publisher

A Helm chart for deploying Valkey in cluster or standalone mode with persistence, monitoring, and automated cluster initialization

About this chart

valkey-cluster

A Helm chart for deploying Valkey in cluster or standalone mode with persistence, monitoring, and automated cluster initialization

Homepage: https://innago-property-management.github.io/helm-charts/valkey-cluster

Maintainers

NameEmailUrl
Innago[email protected]

Source Code

Values

KeyTypeDefaultDescription
affinityobject{"podAntiAffinity":{"type":"preferred","weight":100}}Affinity for pod assignment
affinity.podAntiAffinityobject{"type":"preferred","weight":100}Pod anti-affinity configuration
affinity.podAntiAffinity.typestring"preferred"Use preferred (soft) or required (hard) anti-affinity "preferred" allows pods to be scheduled on same node if necessary "required" enforces strict node distribution
affinity.podAntiAffinity.weightint100Weight for preferred anti-affinity (1-100)
authobject{"autoGenerate":false,"enabled":false,"existingSecret":"","existingSecretPasswordKey":"password","password":""}Valkey authentication configuration
auth.autoGenerateboolfalseAuto-generate a random password if password is empty (and no existingSecret) When enabled, uses lookup function to preserve password across upgrades Set to true for development/testing. Use existingSecret for production.
auth.enabledboolfalseEnable password authentication Set to true and configure ONE of: password, autoGenerate, or existingSecret
auth.existingSecretstring""Name of existing secret containing Valkey password (recommended for production)
auth.existingSecretPasswordKeystring"password"Key in existing secret that contains the password
auth.passwordstring""Valkey password (if not using existingSecret) IMPORTANT: You must configure ONE of: password, autoGenerate=true, or existingSecret Leave empty when using existingSecret or autoGenerate
clusterobject{"allowReadsWhenDown":"no","enabled":true,"init":{"activeDeadlineSeconds":300,"backoffLimit":5,"enabled":true,"hookType":"argocd","readinessTimeout":300},"masterCount":3,"nodeTimeout":5000,"replicaValidityFactor":10,"replicasPerMaster":1,"requireFullCoverage":"no"}Valkey cluster configuration
cluster.allowReadsWhenDownstring"no"Allow reads when cluster is marked as failed
cluster.enabledbooltrueEnable cluster mode (requires minimum 6 replicas)
cluster.initobject{"activeDeadlineSeconds":300,"backoffLimit":5,"enabled":true,"hookType":"argocd","readinessTimeout":300}Enable cluster initialization job
cluster.init.activeDeadlineSecondsint300Init job active deadline in seconds
cluster.init.backoffLimitint5Init job backoff limit
cluster.init.hookTypestring"argocd"Hook type: "argocd" or "helm"
cluster.init.readinessTimeoutint300Timeout waiting for pods to be ready before cluster creation (seconds) Increased from 180s to accommodate slow storage or large RDB restores
cluster.masterCountint3Number of master shards (for cluster mode) Total replicas should be masterCount * (1 + replicasPerMaster)
cluster.nodeTimeoutint5000Cluster node timeout in milliseconds
cluster.replicaValidityFactorint10Replica validity factor (default 10) Controls how long a replica can be disconnected before being invalid for failover
cluster.replicasPerMasterint1Number of replicas per master shard
cluster.requireFullCoveragestring"no"Require full hash slot coverage for cluster to accept writes Set to "no" for partial availability during failures
configobject{"appendfsync":"everysec","appendonly":"yes","custom":"","maxmemory":"1800mb","maxmemory-policy":"noeviction","save":"900 1 300 10 60 10000"}Valkey configuration options These will be merged into valkey.conf
config.appendfsyncstring"everysec"AOF fsync policy
config.appendonlystring"yes"Enable AOF persistence
config.customstring""Additional custom configuration Add any valkey.conf directives here
config.maxmemorystring"1800mb"Maximum memory limit (e.g., "1800mb") Should be ~90% of container memory limit (2Gi = 2048Mi → 1800mb recommended) Leave empty for no limit (not recommended for production)
config.maxmemory-policystring"noeviction"Maximum memory policy
config.savestring"900 1 300 10 60 10000"Save snapshots to disk
containerEnvFromlist[]Container environment from (ConfigMap/Secret references)
containerEnvironmentVariableslist[]Container environment variables
containerSecurityContextobject{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":false,"runAsGroup":1000,"runAsNonRoot":true,"runAsUser":1000}Container security context
fullnameOverridestring""String to fully override valkey-cluster.fullname
image.pullPolicystring"IfNotPresent"Image pull policy
image.repositorystring"docker.io/valkey/valkey"Valkey Docker image repository
image.tagstring""Overrides the image tag whose default is the chart appVersion
imagePullSecretslist[]Docker registry secret names as an array
lifecycleobject{"preStop":{"delay":5,"enabled":true}}Lifecycle hooks configuration
lifecycle.preStopobject{"delay":5,"enabled":true}preStop hook for graceful shutdown
lifecycle.preStop.delayint5Delay in seconds after triggering BGSAVE before shutdown
lifecycle.preStop.enabledbooltrueEnable preStop hook
livenessProbeobject{"enabled":true,"failureThreshold":3,"initialDelaySeconds":30,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":5}Liveness probe configuration
metricsobject{"enabled":true,"image":{"pullPolicy":"IfNotPresent","repository":"oliver006/redis_exporter","tag":"v1.66.0"},"port":9121,"resources":{"limits":{"cpu":"100m","memory":"128Mi"},"requests":{"cpu":"50m","memory":"64Mi"}},"securityContext":{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":true,"runAsGroup":1000,"runAsNonRoot":true,"runAsUser":1000}}Prometheus metrics exporter configuration
metrics.enabledbooltrueEnable redis_exporter sidecar for Prometheus metrics
metrics.imageobject{"pullPolicy":"IfNotPresent","repository":"oliver006/redis_exporter","tag":"v1.66.0"}redis_exporter image
metrics.portint9121redis_exporter port
metrics.resourcesobject{"limits":{"cpu":"100m","memory":"128Mi"},"requests":{"cpu":"50m","memory":"64Mi"}}redis_exporter resources
metrics.securityContextobject{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":true,"runAsGroup":1000,"runAsNonRoot":true,"runAsUser":1000}redis_exporter security context
nameOverridestring""String to partially override valkey-cluster.fullname
networkPolicyobject{"egress":{"customRules":[],"dns":{"to":[]},"enabled":false},"enabled":false,"ingress":{"allowExternal":false,"customRules":[],"namespaceSelector":{},"podSelector":{},"prometheusNamespaceSelector":{}}}Network policy configuration
networkPolicy.egressobject{"customRules":[],"dns":{"to":[]},"enabled":false}Egress rules configuration
networkPolicy.egress.customRuleslist[]Custom egress rules (advanced)
networkPolicy.egress.dnsobject{"to":[]}DNS egress configuration
networkPolicy.egress.dns.tolist[]Custom DNS egress selectors (overrides defaults) If unset, defaults to kube-system namespace with kube-dns labels For CoreDNS or different configurations, customize these selectors Example for custom CoreDNS: to: - namespaceSelector: matchLabels: kubernetes.io/metadata.name: kube-system - podSelector: matchLabels: k8s-app: coredns
networkPolicy.egress.enabledboolfalseEnable egress rules (restricts outbound traffic)
networkPolicy.enabledboolfalseEnable NetworkPolicy creation
networkPolicy.ingressobject{"allowExternal":false,"customRules":[],"namespaceSelector":{},"podSelector":{},"prometheusNamespaceSelector":{}}Ingress rules configuration
networkPolicy.ingress.allowExternalboolfalseAllow external client connections (beyond pod-to-pod) Requires at least one of namespaceSelector or podSelector to be set
networkPolicy.ingress.customRuleslist[]Custom ingress rules (advanced)
networkPolicy.ingress.namespaceSelectorobject{}Namespace selector for allowed clients Example: namespaceSelector: { matchLabels: { name: "app-namespace" } }
networkPolicy.ingress.podSelectorobject{}Pod selector for allowed clients Example: podSelector: { matchLabels: { app: "my-app" } }
networkPolicy.ingress.prometheusNamespaceSelectorobject{}Namespace selector for Prometheus Example: prometheusNamespaceSelector: { matchLabels: { name: "monitoring" } }
nodeSelectorobject{}Node selector for pod assignment Example for Karpenter: { karpenter.sh/nodepool: stateful } Example for node type: { node.kubernetes.io/instance-type: m5.large }
persistenceobject{"accessModes":["ReadWriteOnce"],"annotations":{},"enabled":true,"size":"8Gi","storageClass":""}Persistence configuration
persistence.accessModeslist["ReadWriteOnce"]PVC Access Mode
persistence.annotationsobject{}Annotations for PVCs
persistence.enabledbooltrueEnable persistence using PVC
persistence.sizestring"8Gi"PVC Storage Request
persistence.storageClassstring""PVC Storage Class Leave empty ("") to use cluster default storage class If set to "-", storageClassName: "", which disables dynamic provisioning Set to specific class name for cloud providers (e.g., "ebs-sc" for AWS, "standard-rwo" for GKE)
podAnnotationsobject{}Annotations to add to the pod
podDisruptionBudgetobject{"enabled":true,"maxUnavailable":null,"minAvailable":null}Pod disruption budget configuration
podDisruptionBudget.enabledbooltrueEnable PodDisruptionBudget
podDisruptionBudget.maxUnavailablestringnilMaximum unavailable pods (alternative to minAvailable) If both minAvailable and maxUnavailable are null, minAvailable is auto-calculated
podDisruptionBudget.minAvailablestringnilMinimum available pods If not set, defaults to: - Cluster mode: masterCount + 1 [ensures quorum is maintained] - Standalone mode: 1 [keeps at least 1 instance] Set explicitly to override auto-calculation
podSecurityContextobject{"fsGroup":1000,"runAsGroup":1000,"runAsUser":1000}Pod security context
readinessProbeobject{"enabled":true,"failureThreshold":3,"initialDelaySeconds":10,"periodSeconds":5,"successThreshold":1,"timeoutSeconds":3}Readiness probe configuration
replicaCountint6Number of Valkey replicas to deploy For cluster mode: minimum 6 (3 masters + 3 replicas) For standalone mode: 1-2
resourcesobject{"limits":{"cpu":"1000m","memory":"2Gi"},"requests":{"cpu":"250m","memory":"512Mi"}}Resource limits and requests
serviceobject{"client":{"annotations":{},"port":6379,"type":"ClusterIP"},"headless":{"annotations":{},"clusterIP":"None","type":"ClusterIP"}}Service configuration
service.clientobject{"annotations":{},"port":6379,"type":"ClusterIP"}Client service for application access
service.client.annotationsobject{}Annotations for client service
service.client.portint6379Service port
service.client.typestring"ClusterIP"Service type for client service
service.headlessobject{"annotations":{},"clusterIP":"None","type":"ClusterIP"}Headless service for StatefulSet pod DNS
service.headless.annotationsobject{}Annotations for headless service
service.headless.clusterIPstring"None"Cluster IP (use "None" for headless)
service.headless.typestring"ClusterIP"Service type for headless service
serviceAccount.annotationsobject{}Annotations to add to the service account
serviceAccount.createbooltrueSpecifies whether a service account should be created
serviceAccount.namestring""The name of the service account to use. If not set and create is true, a name is generated using the fullname template
serviceMonitorobject{"enabled":true,"interval":"30s","labels":{"release":"prometheus"},"namespace":"","namespaceSelector":{},"scrapeTimeout":"10s"}ServiceMonitor configuration for Prometheus Operator
serviceMonitor.enabledbooltrueEnable ServiceMonitor creation
serviceMonitor.intervalstring"30s"ServiceMonitor scrape interval
serviceMonitor.labelsobject{"release":"prometheus"}ServiceMonitor labels
serviceMonitor.namespacestring""ServiceMonitor namespace (defaults to release namespace)
serviceMonitor.namespaceSelectorobject{}Namespace selector for ServiceMonitor (if monitoring across namespaces) Example: namespaceSelector: { matchNames: ["valkey-cluster"] }
serviceMonitor.scrapeTimeoutstring"10s"ServiceM

Deploy valkey-cluster with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has valkey-cluster on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartvalkey-cluster is pinned at v1.1.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply