redis

by somaz94

Helm chartv0.1.2App 8.2-alpineApache-2.0Verified publisher

Standalone single-node Redis — Deployment + optional Secret + optional ConfigMap (redis.conf) + PVC + Service, NetworkPolicy, ServiceAccount. Recreate strategy. No backup CronJob (Redis is typically a cache; if you need persistence + offsite backups, prefer Sentinel/Cluster topology). Suits dev/staging single-replica installs and legacy raw-YAML migrations (existingClaim / existingSecret / fullnameOverride for in-place adoption). Sibling chart to `valkey-cr` — choose by license / compatibility preference.

About this chart

redis

Standalone single-node Redis chart — Deployment + PVC + Service, with optional Secret (auth password), optional ConfigMap (redis.conf), NetworkPolicy, ServiceAccount and chart-managed image pull Secret. Designed for dev / staging / single-replica caches and in-place migration off legacy raw-YAML deployments (existingClaim, existingSecret, fullnameOverride, custom mountPath).

For HA prefer Sentinel / Cluster topology — out of scope.

Looking for Redis-API compatible without Redis Source-Available License v2 / SSPL exposure? See the sibling chart valkey-cr.

What it deploys

ResourceAlways renderedNotes
Deploymentyessingle replica, Recreate strategy
ServiceyesClusterIP default, NodePort opt-in
PersistentVolumeClaimwhen persistence.enabled is true and persistence.existingClaim is emptymounted at persistence.mountPath (default /data)
Secretwhen auth.enabled is true and auth.existingSecret is emptyholds the Redis password under auth.passwordKey
ConfigMapwhen customConfig is non-emptyredis.conf mounted at /etc/redis, container starts with redis-server /etc/redis/redis.conf
Secret (dockerconfigjson)when imagePullSecret.create is trueadditive to imagePullSecrets[]
ServiceAccountwhen serviceAccount.create is truescope-pinned IRSA / pull Secrets
NetworkPolicywhen networkPolicy.enabled is truenative networking.k8s.io/v1 shape

No backup CronJob — Redis is typically a cache, and its canonical persistence (RDB / AOF) lives on the same volume. For offsite backups run a sidecar that uploads RDB to object storage.

Prerequisites

  • Kubernetes >= 1.25
  • A StorageClass for the data PVC (or supply persistence.existingClaim)

Install

OCI registry (Helm 3.8+)

helm install dev-redis oci://ghcr.io/somaz94/charts/redis --version 0.1.0 \
  --namespace myapp-db-redis --create-namespace

Classic Helm repo

helm repo add somaz94 https://charts.somaz.blog
helm install dev-redis somaz94/redis --version 0.1.0 \
  --namespace myapp-db-redis --create-namespace \
  -f my-values.yaml

Quick examples

1. Default — no auth, default config, chart-managed PVC (dev cache)

persistence:
  size: 5Gi
service:
  type: ClusterIP

2. Auth enabled + tuned config

auth:
  enabled: true
  password: changeme
customConfig: |
  maxmemory 1gb
  maxmemory-policy allkeys-lru
  appendonly yes
  appendfsync everysec
  tcp-keepalive 60
service:
  type: NodePort
  nodePort: 30490

3. Adopt a pre-existing raw-YAML deployment in place (no data movement)

The legacy raw-YAML for dev-myapp-redis mounted the PVC at /redis-master-data rather than the standard /data. The chart's persistence.mountPath lets you preserve that mount layout so Redis finds its existing RDB / AOF files.

fullnameOverride: dev-myapp-redis

persistence:
  existingClaim: dev-myapp-redis-pvc
  mountPath: /redis-master-data        # legacy raw-YAML path

service:
  type: NodePort
  nodePort: 30479

imagePullSecrets:
  - name: harbor-robot-secret

Adoption checklist before helm upgrade --install:

KCTX=<your-context>
NS=myapp-db-redis

# 1. Annotate existing resources for Helm ownership
for kind in pvc/dev-myapp-redis-pvc service/dev-myapp-redis; do
  kubectl --context $KCTX -n $NS annotate "$kind" \
    meta.helm.sh/release-name=dev-myapp-redis \
    meta.helm.sh/release-namespace=$NS --overwrite
  kubectl --context $KCTX -n $NS label "$kind" \
    app.kubernetes.io/managed-by=Helm --overwrite
done

# 2. (Optional) belt-and-suspenders against accidental future helm uninstall
kubectl --context $KCTX -n $NS annotate pvc dev-myapp-redis-pvc \
  helm.sh/resource-policy=keep --overwrite

# 3. Drop the legacy Deployment so Helm can recreate with new selector
kubectl --context $KCTX -n $NS delete deployment dev-myapp-redis --wait

# 4. helm install. After install, remove stale `app:` key from Service
#    selector that helm's client-side merge left behind:
kubectl --context $KCTX -n $NS patch svc dev-myapp-redis \
  --type=json -p='[{"op":"remove","path":"/spec/selector/app"}]'

4. Reuse a pre-existing auth Secret with a non-standard key

auth:
  enabled: true
  existingSecret: app-shared-redis-creds
  passwordKey: REDIS_AUTH_TOKEN          # legacy key name in the existing Secret

5. Private registry — chart-managed pull Secret

imagePullSecret:
  create: true
  dockerconfigjson: <base64 ~/.docker/config.json>
image:
  repository: harbor.example.com/library/redis
  tag: "7.4-alpine"

Values reference

Naming + adoption

KeyDefaultDescription
nameOverride""overrides app.kubernetes.io/name label
fullnameOverride""overrides the base name for Deployment / Service / default PVC / default Secret / default ConfigMap
configMap.nameOverride""overrides only the ConfigMap name (default <fullname>-config)

Image

KeyDefaultDescription
image.repositoryrediscontainer image repository
image.tag"" (= Chart.AppVersion, currently 8.2-alpine)tag override. NOTE: Redis 7.5+ is licensed under RSALv2 / SSPL (not OSI-approved). Pin to 7.4-alpine to stay on the last BSD-licensed Redis. The chart itself is Apache-2.0.
image.pullPolicyIfNotPresent
imagePullSecrets[][]bring-your-own pull Secrets, additive
imagePullSecret.createfalserender a dockerconfigjson Secret
imagePullSecret.name"" (= <fullname>-pull-secret)name override
imagePullSecret.dockerconfigjson""base64-encoded ~/.docker/config.json

Service

KeyDefaultDescription
service.typeClusterIPone of ClusterIP / NodePort / LoadBalancer
service.port6379
service.nodePortnullrequired when service.type=NodePort and you want a fixed port
service.annotations{}merged with commonAnnotations

Persistence

KeyDefaultDescription
persistence.enabledtruewhen false, mounts an emptyDir (cache-only mode)
persistence.storageClass""empty = cluster default
persistence.accessModes[ReadWriteOnce]
persistence.size5Gi
persistence.existingClaim""when set, chart skips PVC rendering and the Pod mounts this PVC
persistence.annotations{}merged with commonAnnotations
persistence.mountPath/datamount path inside the Redis container

Authentication

KeyDefaultDescription
auth.enabledfalsetoggle requirepass
auth.password""required when auth.enabled is true and existingSecret is empty
auth.existingSecret""when set, chart skips Secret rendering
auth.passwordKeyredis-passwordsecret key the container reads REDIS_PASSWORD from

Configuration

KeyDefaultDescription
customConfig""when non-empty, rendered into a ConfigMap as redis.conf and mounted at /etc/redis. Container starts with redis-server /etc/redis/redis.conf. When empty, the container runs the image's default config.

When both customConfig and auth.enabled are set, the container is started with --requirepass $(REDIS_PASSWORD) appended after the config-file argument so the env-injected password takes precedence over any inline requirepass directive in customConfig. The password value is sourced from the Secret at runtime — never written to the rendered ConfigMap.

Pod scheduling + resources

KeyDefaultDescription
resources.requests.cpu100m
resources.requests.memory256Mi
resources.limits.cpu500m
resources.limits.memory1Gi
nodeSelector / tolerations / affinity / topologySpreadConstraints / priorityClassNameemptystandard pod scheduling knobs
podSecurityContext / securityContext{}
livenessProbe / readinessProbeTCP probe on redis portsafe to leave on by default

Escape hatches

KeyDefaultDescription
commonLabels / commonAnnotations{}applied to every resource
resourceMetadata.<resource>.{labels,annotations}{}per-resource override
specExtra{}merged into Deployment.spec
podTemplateExtra{}merged into PodTemplateSpec.spec
kubernetesExtra{}each value rendered as an additional manifest in this release
serviceAccount.{create,name,annotations,imagePullSecrets,automountServiceAccountToken}create=falsescope-pinned SA
networkPolicy.{enabled,policyTypes,ingress,egress,podSelector}enabled=falsenative networking.k8s.io/v1 shape

License

Apache-2.0

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 v0.1.2 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