valkey
by Start Codex
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
| Feature | Description |
|---|---|
| Standalone Mode | Simple single-instance deployment |
| Sentinel Mode | High availability with automatic failover |
| Authentication | Support for password and existing secrets |
| Persistence | Configurable persistent volumes |
| Metrics | Built-in Prometheus exporter |
| Security | SecurityContext, NetworkPolicies, RBAC |
| Quiet Upgrades | A chart version bump changes no immutable StatefulSet field and no pod template, so it neither fails nor restarts pods |
| TLS | Support for encrypted connections |
Requirements
| Component | Version |
|---|---|
| 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
latesttag - Automatic updates: Using
latestensures 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
latestprovides 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
| Parameter | Description | Default |
|---|---|---|
architecture | Deployment mode: standalone or sentinel | standalone |
global.imageRegistry | Global registry for all images | "" |
global.storageClass | Global StorageClass | "" |
clusterDomain | Kubernetes cluster domain | cluster.local |
Image
| Parameter | Description | Default |
|---|---|---|
image.registry | Image registry | cgr.dev |
image.repository | Image repository | chainguard/valkey |
image.tag | Image tag (see Image Versioning Strategy) | latest |
image.pullPolicy | Pull policy | IfNotPresent |
Authentication
| Parameter | Description | Default |
|---|---|---|
auth.enabled | Enable authentication | false |
auth.password | Password (not recommended for production) | "" |
auth.existingSecret | Name of existing Secret | "" |
auth.existingSecretPasswordKey | Password key in Secret | password |
Standalone
| Parameter | Description | Default |
|---|---|---|
standalone.replicaCount | Number of replicas | 1 |
standalone.persistence.enabled | Enable persistence | true |
standalone.persistence.size | Volume size | 8Gi |
standalone.persistence.storageClass | StorageClass | "" |
standalone.service.type | Service type | ClusterIP |
standalone.service.port | Service port | 6379 |
standalone.resources.requests.memory | Memory request | 128Mi |
standalone.resources.requests.cpu | CPU request | 100m |
standalone.resources.limits.memory | Memory limit | 256Mi |
Sentinel
| Parameter | Description | Default |
|---|---|---|
sentinel.replicaCount | Number of sentinels | 3 |
sentinel.quorum | Quorum for failover | 2 |
sentinel.downAfterMilliseconds | Time to detect failure | 30000 |
sentinel.failoverTimeout | Failover timeout | 30000 |
sentinel.masterSet | Monitored master set name | mymaster |
master.replicaCount | Number of masters | 1 |
replica.replicaCount | Number of replicas | 2 |
Metrics
| Parameter | Description | Default |
|---|---|---|
metrics.enabled | Enable Prometheus exporter | false |
metrics.image.repository | Exporter image | oliver006/redis_exporter |
metrics.image.tag | Exporter tag | v1.91.1 |
metrics.serviceMonitor.enabled | Create ServiceMonitor | false |
metrics.podMonitor.enabled | Create PodMonitor | false |
Security
| Parameter | Description | Default |
|---|---|---|
podSecurityContext.fsGroup | Filesystem group | 65532 |
podSecurityContext.runAsUser | Container user | 65532 |
podSecurityContext.runAsGroup | Container group | 65532 |
securityContext.runAsNonRoot | Run as non-root | true |
securityContext.readOnlyRootFilesystem | Read-only filesystem | true |
networkPolicy.enabled | Enable NetworkPolicy | false |
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-cliyou can point at the release, and a pinned tag makes them reproducible — which the chart's owncgr.dev/chainguard/valkey:latestdefault 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
volumeClaimTemplatescarried thehelm.sh/chartandapp.kubernetes.io/versionlabels. Those change with every release, andvolumeClaimTemplatesis immutable, so every upgrade failed withForbidden: updates to statefulset specunless 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 novolumeClaimTemplates, 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartvalkey is pinned at v0.3.7 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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