valkey

by Start Codex

Helm chartv0.3.7App 9.1.3Apache-2.0Verified publisher

Valkey is an open source, high-performance data structure server compatible with Redis. It supports strings, hashes, lists, sets, and sorted sets.

About this chart

Valkey Helm Chart

Helm chart for deploying Valkey on Kubernetes. Valkey is a high-performance, open-source data structure server compatible with Redis.

Table of Contents

  • Features
  • Requirements
  • Image Versioning Strategy
  • Quick Start
  • Architectures
  • Configuration
  • Examples
  • Connecting to Valkey
  • Upgrades
  • Monitoring
  • Security
  • Troubleshooting
  • Uninstallation
  • Development
  • Contributing
  • Links
  • License

Features

FeatureDescription
Standalone ModeSimple single-instance deployment
Sentinel ModeHigh availability with automatic failover
AuthenticationSupport for password and existing secrets
PersistenceConfigurable persistent volumes
MetricsBuilt-in Prometheus exporter
SecuritySecurityContext, NetworkPolicies, RBAC
Quiet UpgradesA chart version bump changes no immutable StatefulSet field and no pod template, so it neither fails nor restarts pods
TLSSupport for encrypted connections

Requirements

ComponentVersion
Kubernetes>= 1.23
Helm>= 3.8

Image Versioning Strategy

This chart uses Chainguard's zero-CVE Valkey images for enhanced security.

Why latest tag?

  • Free tier limitation: Chainguard's free tier only provides the latest tag
  • Automatic updates: Using latest ensures you always get the most recent security patches
  • Zero CVEs: Chainguard images are rebuilt continuously to maintain zero known vulnerabilities

Version tracking

  • appVersion in Chart.yaml: Reflects the current Valkey version available in cgr.dev/chainguard/valkey:latest
  • Automated updates: A GitHub Action checks weekly for version updates and creates PRs automatically
  • Transparency: Every version change is tracked via pull requests and changelog entries

For production use

If you require version pinning for production:

# Override with a specific version (requires Chainguard Pro or alternative registry)
image:
  registry: docker.io        # The default is cgr.dev, so override it too
  repository: valkey/valkey  # Official Valkey images
  tag: "9.1.2"               # Specific version tag

Note: Using latest provides continuous security updates but means deployments may pull different versions over time. For strict reproducibility, consider using image digests or switching to a registry that provides versioned tags.

Quick Start

# Add the repository
helm repo add valkey https://start-codex.github.io/valkey-helm-chart
helm repo update

# Install with default values
helm install my-valkey valkey/valkey

# Install with authentication
helm install my-valkey valkey/valkey \
  --set auth.enabled=true \
  --set auth.password="your-secure-password"

Architectures

Standalone (Default)

Simple deployment with a single Valkey instance. Ideal for development and workloads that don't require high availability.

+------------------+
|     Valkey       |
|   (standalone)   |
+------------------+
        |
+------------------+
|       PVC        |
+------------------+
helm install my-valkey valkey/valkey

Sentinel (High Availability)

Architecture with master, replicas, and sentinels for automatic failover. Recommended for production.

+------------------+     +------------------+     +------------------+
|     Sentinel     |     |     Sentinel     |     |     Sentinel     |
+------------------+     +------------------+     +------------------+
         |                       |                        |
         +-------------+---------+------------------------+
                       |
         +-------------+-------------+
         |             |             |
+--------v---+  +------v-----+  +----v-------+
|   Master   |  |  Replica   |  |  Replica   |
+------------+  +------------+  +------------+
      |              |               |
+-----v----+  +------v-----+  +-----v------+
|   PVC    |  |    PVC     |  |    PVC     |
+----------+  +------------+  +------------+
helm install my-valkey valkey/valkey \
  --set architecture=sentinel \
  --set sentinel.replicaCount=3 \
  --set replica.replicaCount=2

Configuration

Global Parameters

ParameterDescriptionDefault
architectureDeployment mode: standalone or sentinelstandalone
global.imageRegistryGlobal registry for all images""
global.storageClassGlobal StorageClass""
clusterDomainKubernetes cluster domaincluster.local

Image

ParameterDescriptionDefault
image.registryImage registrycgr.dev
image.repositoryImage repositorychainguard/valkey
image.tagImage tag (see Image Versioning Strategy)latest
image.pullPolicyPull policyIfNotPresent

Authentication

ParameterDescriptionDefault
auth.enabledEnable authenticationfalse
auth.passwordPassword (not recommended for production)""
auth.existingSecretName of existing Secret""
auth.existingSecretPasswordKeyPassword key in Secretpassword

Standalone

ParameterDescriptionDefault
standalone.replicaCountNumber of replicas1
standalone.persistence.enabledEnable persistencetrue
standalone.persistence.sizeVolume size8Gi
standalone.persistence.storageClassStorageClass""
standalone.service.typeService typeClusterIP
standalone.service.portService port6379
standalone.resources.requests.memoryMemory request128Mi
standalone.resources.requests.cpuCPU request100m
standalone.resources.limits.memoryMemory limit256Mi

Sentinel

ParameterDescriptionDefault
sentinel.replicaCountNumber of sentinels3
sentinel.quorumQuorum for failover2
sentinel.downAfterMillisecondsTime to detect failure30000
sentinel.failoverTimeoutFailover timeout30000
sentinel.masterSetMonitored master set namemymaster
master.replicaCountNumber of masters1
replica.replicaCountNumber of replicas2

Metrics

ParameterDescriptionDefault
metrics.enabledEnable Prometheus exporterfalse
metrics.image.repositoryExporter imageoliver006/redis_exporter
metrics.image.tagExporter tagv1.91.1
metrics.serviceMonitor.enabledCreate ServiceMonitorfalse
metrics.podMonitor.enabledCreate PodMonitorfalse

Security

ParameterDescriptionDefault
podSecurityContext.fsGroupFilesystem group65532
podSecurityContext.runAsUserContainer user65532
podSecurityContext.runAsGroupContainer group65532
securityContext.runAsNonRootRun as non-roottrue
securityContext.readOnlyRootFilesystemRead-only filesystemtrue
networkPolicy.enabledEnable NetworkPolicyfalse

Examples

Local Development

# values-dev.yaml
architecture: standalone
auth:
  enabled: false
standalone:
  persistence:
    enabled: false
  resources:
    requests:
      memory: 64Mi
      cpu: 50m
    limits:
      memory: 128Mi
helm install valkey-dev valkey/valkey -f values-dev.yaml

Production with Authentication

# values-prod.yaml
architecture: standalone
auth:
  enabled: true
  existingSecret: valkey-secret
  existingSecretPasswordKey: password
standalone:
  persistence:
    enabled: true
    storageClass: fast-ssd
    size: 50Gi
  resources:
    requests:
      memory: 1Gi
      cpu: 500m
    limits:
      memory: 2Gi
metrics:
  enabled: true
  serviceMonitor:
    enabled: true
# Create the secret first
kubectl create secret generic valkey-secret \
  --from-literal=password="your-super-secure-password"

# Install
helm install valkey-prod valkey/valkey -f values-prod.yaml

High Availability with Sentinel

# values-ha.yaml
architecture: sentinel
auth:
  enabled: true
  password: "ha-password"

sentinel:
  replicaCount: 3
  quorum: 2
  resources:
    requests:
      memory: 128Mi
      cpu: 100m

master:
  persistence:
    enabled: true
    size: 20Gi
  resources:
    requests:
      memory: 512Mi
      cpu: 250m
    limits:
      memory: 1Gi

replica:
  replicaCount: 2
  persistence:
    enabled: true
    size: 20Gi
  resources:
    requests:
      memory: 512Mi
      cpu: 250m
    limits:
      memory: 1Gi

metrics:
  enabled: true
  serviceMonitor:
    enabled: true
helm install valkey-ha valkey/valkey -f values-ha.yaml

With Network Policies

# values-secure.yaml
architecture: standalone
auth:
  enabled: true
  existingSecret: valkey-secret

networkPolicy:
  enabled: true
  allowExternal: false
  ingressNSMatchLabels:
    app: my-app

Connecting to Valkey

The throwaway client pods below use the official Docker Hub image, not the image this chart deploys. They exist only to get a valkey-cli you can point at the release, and a pinned tag makes them reproducible — which the chart's own cgr.dev/chainguard/valkey:latest default cannot offer on the free tier. Nothing here changes what the chart runs.

From Inside the Cluster

# Temporary pod for testing (client only, unrelated to the deployed image)
kubectl run valkey-client --rm -it \
  --image=valkey/valkey:9.1.2 \
  -- valkey-cli -h my-valkey

# With authentication
kubectl run valkey-client --rm -it \
  --image=valkey/valkey:9.1.2 \
  -- valkey-cli -h my-valkey -a "your-password"

Port-forward for Local Access

kubectl port-forward svc/my-valkey 6379:6379

# In another terminal
valkey-cli -h localhost -p 6379

Sentinel - Get Current Master

kubectl run valkey-client --rm -it \
  --image=valkey/valkey:9.1.2 \
  -- valkey-cli -h my-valkey-sentinel -p 26379

# Useful sentinel commands
> SENTINEL masters
> SENTINEL get-master-addr-by-name mymaster
> SENTINEL replicas mymaster

Upgrades

An upgrade is a plain Helm rolling update, and from 0.3.2 on a version bump alone does not restart any pod.

Two things make that true. No StatefulSet field that Kubernetes refuses to update in place (serviceName, selector, volumeClaimTemplates, podManagementPolicy) changes between releases, so nothing has to be deleted and recreated. And no pod template changes either: the pod templates and both ConfigMaps use only the stable selector labels, so the checksum/configmap and checksum/health annotations stay put unless the configuration itself changes. Pods restart when the image or the configuration changes, and not otherwise.

Upgrading from 0.2.10 or earlier: one manual step

Up to 0.2.10 the volumeClaimTemplates carried the helm.sh/chart and app.kubernetes.io/version labels. Those change with every release, and volumeClaimTemplates is immutable, so every upgrade failed with Forbidden: updates to statefulset spec unless the StatefulSets were deleted first. From 0.3.0 they use the stable selector labels instead.

Moving onto 0.3.0 is therefore the last upgrade that changes an immutable field. Run it once with --set preUpgradeHook.enabled=true, or delete the StatefulSets yourself with --cascade=orphan. In sentinel mode, do not delete the sentinel StatefulSet: it has no volumeClaimTemplates, it never needed recreating, and restarting the sentinels together with the data pods is how an upgrade ends up with no master at all. Delete the master and replica StatefulSets one at a time, waiting for each to come back.

Upgrading from 0.3.0 or 0.3.1: one more restart

0.3.1 removes the chart version from the pod templates and the ConfigMaps, so the checksum annotations settle and every pod restarts once. 0.3.2 edits the startup script, which lives in the pod template, so it restarts pods as well — that is a real change to what the pods run, not a bare version bump. Both are plain rolling updates: no immutable field changes, nothing to delete.

From 0.3.2 on, a release that only bumps the version restarts nothing. A release that changes the scripts or the configuration still restarts pods, as it should: that is what the checksum annotations are for.

The pre-upgrade hook

Disabled by default (preUpgradeHook.enabled). It deletes the StatefulSets with --cascade=orphan — pods and PVCs survive — so Helm can recreate them. Enab

Deploy valkey with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has valkey 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 is pinned at v0.3.7 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