redis

by emberstack

Helm chartv1.0.22App 8.0.2Verified publisher

A Helm chart for deploying Redis on Kubernetes

About this chart

Redis Helm Chart

A Helm chart for deploying Redis on Kubernetes with support for standalone, replication, sentinel (HA), and cluster (sharded) architectures.

Installation

Using OCI registry (recommended)

helm install redis oci://ghcr.io/emberstack/helm-charts/redis

Using Helm repository

helm repo add emberstack https://emberstack.github.io/helm-charts
helm repo update
helm upgrade --install redis emberstack/redis

Architectures

ModeDescriptionMinimum Pods
standaloneSingle Redis node1
replicationOne master + N replicas (manual failover)3
replication + sentinel.enabledHA with automatic failover via Sentinel3
clusterSharded across multiple masters with optional replicas3 (no replicas) or 6 (with replicas)

Standalone

helm install redis oci://ghcr.io/emberstack/helm-charts/redis \
  --set architecture=standalone

Replication

helm install redis oci://ghcr.io/emberstack/helm-charts/redis \
  --set architecture=replication

Sentinel (HA)

helm install redis oci://ghcr.io/emberstack/helm-charts/redis \
  --set architecture=replication \
  --set sentinel.enabled=true

With master-discovery service (for non-Sentinel-aware clients):

helm install redis oci://ghcr.io/emberstack/helm-charts/redis \
  --set architecture=replication \
  --set sentinel.enabled=true \
  --set sentinel.masterService.enabled=true

Cluster (Sharded)

helm install redis oci://ghcr.io/emberstack/helm-charts/redis \
  --set architecture=cluster \
  --set replicaCount=6 \
  --set cluster.replicaCount=1

Production Hardening

PodDisruptionBudget

Recommended for all multi-node deployments (replication, sentinel, cluster). Prevents Kubernetes from evicting too many Redis pods simultaneously during node drains or cluster upgrades, which could cause data loss or total outage.

pdb:
  enabled: true
  maxUnavailable: 1

Disabling Dangerous Commands

Commands can be disabled by renaming them to empty strings. Note that disabling CONFIG will break the redis-exporter metrics sidecar, which calls CONFIG GET to collect metrics. Consider using Redis ACLs (Redis 6+) for per-user command restrictions instead of global renames.

disableCommands:
  - FLUSHDB
  - FLUSHALL
  - DEBUG
  - KEYS

TLS

tls:
  enabled: true
  existingSecret: redis-tls
  certFilename: tls.crt
  certKeyFilename: tls.key
  certCAFilename: ca.crt

NetworkPolicy

networkPolicy:
  enabled: true
  policyTypes:
    - Ingress
    - Egress
  allowExternalDNS: true

Parameters

Global parameters

ParameterDescriptionDefault
global.image.registryOverride image registry for all containers""
global.image.tagOverride image tag for all containers""
global.image.pullSecretsPull secrets for all containers[]
global.storageClassOverride storage class""

Common parameters

ParameterDescriptionDefault
nameOverrideOverride chart name""
fullnameOverrideOverride fully qualified app name""
namespaceOverrideOverride namespace""
commonLabelsLabels added to all resources{}
commonAnnotationsAnnotations added to all resources{}
extraObjectsExtra Kubernetes resources to deploy[]
clusterDomainKubernetes cluster domaincluster.local

Image parameters

ParameterDescriptionDefault
image.registryRedis image registrydocker.io
image.repositoryRedis image repositoryredis
image.tagRedis image tag8.0.2
image.digestImage digest (overrides tag)""
image.pullPolicyImage pull policyIfNotPresent
image.pullSecretsImage pull secrets[]
testImage.registryTest image registry (overrides image.registry for tests)""
testImage.repositoryTest image repository""
testImage.tagTest image tag""
testImage.pullPolicyTest image pull policy""

Architecture

ParameterDescriptionDefault
architectureRedis architecture (standalone, replication, cluster)standalone
replicaCountNumber of Redis pods3

Redis configuration

ParameterDescriptionDefault
config.contentBase redis.conf contentbind * -::*, appendonly yes
config.existingConfigMapUse existing ConfigMap for config""
config.mountPathConfig mount path/usr/local/etc/redis
extraConfigExtra config appended after config.content""
extraFlagsExtra redis-server CLI flags[]
disableCommandsCommands to disable via rename[]

Authentication

ParameterDescriptionDefault
auth.enabledEnable password authenticationtrue
auth.passwordRedis password (auto-generated if empty)""
auth.existingSecretUse existing secret for password""
auth.existingSecretKeyKey in existing secretredis-password
auth.sentinelEnable sentinel authenticationfalse

TLS

ParameterDescriptionDefault
tls.enabledEnable TLSfalse
tls.portTLS port6380
tls.authClientsRequire TLS client certificatestrue
tls.existingSecretTLS certificate secret name""
tls.certFilenameCertificate filename in secrettls.crt
tls.certKeyFilenameKey filename in secrettls.key
tls.certCAFilenameCA filename in secretca.crt

Sentinel parameters

ParameterDescriptionDefault
sentinel.enabledEnable Sentinelfalse
sentinel.masterNameSentinel master namemymaster
sentinel.portSentinel port26379
sentinel.quorumSentinel quorum2
sentinel.downAfterMillisecondsDown-after timeout5000
sentinel.failoverTimeoutFailover timeout60000
sentinel.parallelSyncsParallel syncs after failover1
sentinel.redisShutdownWaitFailoverWait for failover on shutdowntrue
sentinel.imageSentinel image override(inherits from main)
sentinel.resourcesSentinel container resources{}
sentinel.masterService.enabledEnable master-discovery servicefalse
sentinel.masterService.checkIntervalMaster check interval (seconds)10
sentinel.masterService.image.registryPod labeler image registrydocker.io
sentinel.masterService.image.repositoryPod labeler image repositorycurlimages/curl
sentinel.masterService.image.tagPod labeler image taglatest
sentinel.masterService.image.pullPolicyPod labeler image pull policyAlways

Cluster parameters

ParameterDescriptionDefault
cluster.replicaCountReplicas per master node1
cluster.announceHostnamesUse hostnames instead of IPstrue
cluster.config.nodeTimeoutCluster node timeout15000
cluster.config.requireFullCoverageRequire full slot coveragetrue
cluster.initJob.resourcesCluster init job resources{}

StatefulSet parameters

ParameterDescriptionDefault
statefulSet.revisionHistoryLimitNumber of old ReplicaSets to retain3
statefulSet.updateStrategy.typeStatefulSet update strategy typeRollingUpdate
statefulSet.podManagementPolicyPod management policyOrderedReady
statefulSet.annotationsAdditional StatefulSet annotations{}
statefulSet.labelsAdditional StatefulSet labels{}
statefulSet.minReadySecondsMinimum seconds before pod is considered ready""

Diagnostic mode

ParameterDescriptionDefault
diagnosticMode.enabledEnable diagnostic mode (overrides command/args and disables probes)false
diagnosticMode.commandCommand override in diagnostic mode["sleep"]
diagnosticMode.argsArgs override in diagnostic mode["infinity"]

Container parameters

ParameterDescriptionDefault
commandOverride container command[]
argsOverride container args[]
resourcesResource requests and limits{}
resourcesPresetResource preset (nano/micro/small/medium/large/xlarge/2xlarge)""

Probes

ParameterDescriptionDefault
livenessProbe.enabledEnable liveness probetrue
readinessProbe.enabledEnable readiness probetrue
startupProbe.enabledEnable startup probetrue
customLivenessProbeOverride liveness probe{}
customReadinessProbeOverride readiness probe{}
customStartupProbeOverride startup probe{}

Pod parameters

ParameterDescriptionDefault
podLabelsAdditional pod labels{}
podAnnotationsAdditional pod annotations{}
podSecurityContextPod security context{fsGroup: 999, seccompProfile: RuntimeDefault}
containerSecurityContextContainer security context{runAsNonRoot: true, runAsUser: 999, readOnlyRootFilesystem: true, allowPrivilegeEscalation: false, capabilities.drop: [ALL]}
podAntiAffinityPresetPod anti-affinity presetsoft
terminationGracePeriodSecondsTermination grace period30

Service parameters

ParameterDescriptionDefault
service.enabledCreate a Servicetrue
service.typeService typeClusterIP
service.portRedis port6379
service.clusterPortCluster bus port16379

PodDisruptionBudget

ParameterDescriptionDefault
pdb.enabledEnable PDBfalse
pdb.minAvailableMinimum available pods""
pdb.maxUnavailableMaximum unavailable pods1

Service account

ParameterDescriptionDefault
serviceAccount.createCreate a ServiceAccounttrue
serviceAccount.nameServiceAccount name (generated if empty)""
serviceAccount.annotationsServiceAccount annotations{}
serviceAccount.automountServiceAccountTokenAutomount API credentialsfalse

RBAC

ParameterDescriptionDefault
rbac.createCreate RBAC resourcesfalse
rbac.clusterRole.rulesClusterRole rules[]
rbac.role.rulesRole rules[]

Autoscaling (HPA)

ParameterDescriptionDefault
autoscaling.enabledEnable Horizontal Pod Autoscalerfalse
autoscaling.minReplicasMinimum number of replicas3
autoscaling.maxReplicasMaximum number of replicas11
autoscaling.targetCPUTarget CPU utilization percentage50
autoscaling.targetMemoryTarget memory utilization percentage""
autoscaling.customMetricsCustom metrics for autoscaling[]

NetworkPolicy

ParameterDescriptionDefault
networkPolicy.enabledEnable NetworkPolicyfalse
networkPolicy.policyTypesPolicy types[Ingress, Egress]
networkPolicy.ingressExtra ingress rules[]
networkPolicy.egressExtra egress rules[]
networkPolicy.allowExternalDNSAllow DNS egresstrue

Metrics (redis-exporter)

ParameterDescriptionDefault
metrics.enabledEnable redis-exporter sidecarfalse
metrics.image.repositoryExporter imageoliver006/redis_exporter
metrics.image.tagExporter tagv1.67.0
metrics.resourcesExporter resources{}
serviceMonitor.enabledEnable ServiceMonitorfalse
prometheusRule.enabledEnable PrometheusRulefalse

Persistence

ParameterDescriptionDefault
persistence.enabledEnable persistencetrue
persistence.storageClassStorage class""
persistence.accessModeAccess modeReadWriteOnce
persistence.sizePVC size8Gi
persistence.existingClaimUse existing PVC""
persistence.mountPathData mount path/data

PVC retention policy

ParameterDescriptionDefault
persistentVolumeClaimRetentionPolicy.enabledEnable PVC retention policy on StatefulSetfalse
persistentVolumeClaimRetentionPolicy.whenDeletedPVC retention when StatefulSet is deletedRetain
persistentVolumeClaimRetentionPolicy.whenScaledPVC retention when StatefulSet is scaled downRetain

IP family

ParameterDescriptionDefault
ipFamilyIP family for Redis announce address (auto, ipv4, ipv6)auto

Init containers

ParameterDescriptionDefault
volumePermissions.enabledRun chown on data volumefalse
volumePermissions.imageVolume permissions imagealpine:latest
sysctl.enabledTune kernel parametersfalse
sysctl.imageSysctl imagealpine:latest

See values.yaml for the full list of parameters.

Deploy redis with OpenTenant

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