redis-chart
by abhijoc85
Enterprise-grade, highly-available Redis for Kubernetes. Supports standalone, Sentinel (automatic failover) and Cluster (sharding) topologies, with TLS, authentication, persistence, Prometheus metrics and production hardening.
About this chart
Redis Helm Chart
Enterprise-grade, highly-available Redis for Kubernetes. One chart, three topologies, production-hardened defaults.
| Modes | standalone, sentinel (auto-failover HA), cluster (sharding) |
| Security | non-root, read-only rootfs, dropped capabilities, auth, optional TLS, NetworkPolicy |
| Observability | Prometheus redis_exporter sidecar, ServiceMonitor, PrometheusRule alerts |
| Resilience | PodDisruptionBudget, pod anti-affinity, topology spread, persistence |
| Default image | docker.io/truebyteinnovation/redis:7.4.2-alpine3.21 |
The default image is multi-arch (
linux/amd64,linux/arm64) and runs on any cluster out of the box.
TL;DR
# From the repo root
helm install my-redis ./helm/redis \
--namespace redis --create-namespace \
--set architecture=sentinel
Retrieve the auto-generated password:
kubectl get secret -n redis my-redis -o jsonpath='{.data.redis-password}' | base64 -d
Smoke-test the release:
helm test my-redis -n redis
Architectures
standalone
Single Redis node, optionally persistent. For dev/test or non-HA caches.
sentinel (recommended for HA)
sentinel.replicaCount nodes (1 master + replicas). Each pod runs a Redis
and a Sentinel container. Sentinels monitor the master and perform automatic
failover. On (re)start every node asks the existing Sentinels who the master is
and configures itself accordingly, so failover survives pod restarts.
Use a Sentinel-aware client pointed at the Sentinel port:
host: my-redis.redis.svc.cluster.local
sentinel port: 26379
master group: mymaster
cluster (sharding)
A Redis Cluster of cluster.masters shards, each with
cluster.replicasPerMaster replicas. A post-install Job
(*-cluster-init) forms the cluster and is idempotent on upgrades. Nodes
advertise via stable pod hostnames (cluster-preferred-endpoint-type hostname),
so the cluster survives pod IP changes. Use a cluster-aware client (-c).
Configuration
Key values (see values.yaml for the full, documented list):
| Value | Default | Description |
|---|---|---|
architecture | sentinel | standalone | sentinel | cluster |
image.repository / image.tag | truebyteinnovation/redis / 7.4.2-alpine3.21 | Container image |
auth.enabled | true | Enable requirepass/masterauth |
auth.password | "" | Explicit password (else auto-generated & persisted) |
auth.existingSecret | "" | Use an existing Secret instead |
auth.usePasswordFiles | true | Mount the password as a file (no env exposure) |
tls.enabled | false | Enable TLS (requires tls.existingSecret) |
sentinel.replicaCount | 3 | Nodes in sentinel mode (≥ 3) |
sentinel.quorum | 2 | Sentinel failover quorum |
sentinel.persistState | true | Persist Sentinel state on the PVC; resume on restart to avoid churn |
cluster.masters | 3 | Cluster shards (≥ 3) |
cluster.replicasPerMaster | 1 | Replicas per shard |
persistence.enabled / persistence.size | true / 8Gi | PVC per node |
metrics.enabled | true | redis_exporter sidecar |
metrics.serviceMonitor.enabled | false | Create a prometheus-operator ServiceMonitor |
metrics.prometheusRule.enabled | false | Create alerting rules |
networkPolicy.enabled | false | Restrict ingress to Redis |
podDisruptionBudget.enabled | true | PDB for HA modes |
Examples
Standalone, no persistence, custom memory policy:
helm install cache ./helm/redis \
--set architecture=standalone \
--set persistence.enabled=false \
--set redis.maxmemory=512mb \
--set redis.maxmemoryPolicy=allkeys-lru
Sentinel HA, 5 nodes, with Prometheus monitoring:
helm install ha ./helm/redis \
--set architecture=sentinel \
--set sentinel.replicaCount=5 \
--set sentinel.quorum=3 \
--set metrics.serviceMonitor.enabled=true \
--set metrics.prometheusRule.enabled=true
Cluster with 6 shards and TLS:
kubectl create secret generic redis-tls \
--from-file=tls.crt --from-file=tls.key --from-file=ca.crt -n redis
helm install shard ./helm/redis -n redis \
--set architecture=cluster \
--set cluster.masters=6 \
--set tls.enabled=true \
--set tls.existingSecret=redis-tls
Security
- Runs as non-root (uid 100 / gid 101), read-only root filesystem, all
Linux capabilities dropped,
RuntimeDefaultseccomp. - Authentication on by default; password stored in a Kubernetes Secret and, when
auth.usePasswordFiles=true, mounted as a file (never placed on the CLI). - The generated password is preserved across
helm upgrade(looked up from the existing Secret) so upgrades never rotate it unexpectedly. - Optional TLS for client and replication traffic.
- Optional
NetworkPolicyto restrict who may connect.
Observability
The redis_exporter sidecar exposes Prometheus metrics on port 9121 via the
*-metrics Service. Enable metrics.serviceMonitor.enabled to register with the
Prometheus Operator and metrics.prometheusRule.enabled for the bundled alerts
(instance down, OOM, too many connections, replication broken, rejected
connections, cluster unhealthy).
Validating changes
This chart is CI-validated with:
helm lint helm/redis
helm template r helm/redis --set architecture=standalone # + sentinel, cluster
# rendered manifests checked with kubeconform against the target k8s version
Supply-chain security
The chart and images are signed with Cosign and ship SBOM + provenance attestations. Verify before deploying:
KEY=https://raw.githubusercontent.com/truebyteinnovation/docker-images/main/assets/cosign.pub
cosign verify --key $KEY oci://registry-1.docker.io/truebyteinnovation/redis-chart:0.1.3
cosign verify --key $KEY docker.io/truebyteinnovation/redis:7.4.2-alpine3.21
cosign verify --key $KEY docker.io/truebyteinnovation/redis-exporter:1.86.0
Roadmap
- OpenTelemetry Collector sidecar option
- Backup/restore (RDB snapshots to object storage) as a CronJob
values.schema.jsonfor richer input validation
License
BSD-3-Clause (matching upstream Redis).
Deploy redis-chart with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has redis-chart 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 chartredis-chart is pinned at v0.1.5 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