redis

by mjpitz

Helm chartv22.4.10App 6.2.6MITVerified publisher

Deploy a highly-available, partition-tolerant Redis cluster fronted by an envoy sidecar. Envoy partitions keys among members of the cluster using a consistent hashing algorithm making it great as a best-effort cache.

About this chart

redis

Deploy a highly-available, partition-tolerant Redis cluster fronted by an envoy sidecar. Envoy partitions keys among members of the cluster using a consistent hashing algorithm making it great as a best-effort cache.

Usage

First, add the dependency to your Chart.yaml file. Like any dependency, you're going to need to run helm dep up to fetch the dependency before installing.

# ...
dependencies:
  # ...
  - name: redis
    version: 22.4.10
    repository: https://mya.sh
    condition: redis.enabled

Then, you'll need to add the appropriate block to your Deployment, StatefulSet, or DaemonSet.

{{- $redisConfig := dict "Chart" (dict "Name" "redis") "Values" .Values.redis "Release" .Release -}}
# ...
spec:
  # ...
  template:
    # ...
    spec:
      # ...
      containers:
        # ...
        {{- if .Values.redis.enabled }}
        {{- include "redis.cluster.container" $redisConfig | nindent 8 }}
        {{- end }}
      volumes:
        # ...
        {{- if .Values.redis.enabled }}
        {{- include "redis.cluster.volume" $redisConfig | nindent 8 }}
        {{- end }}

Finally, we'll need to add some additional configuration to the values.yaml file.

# ...
redis:
  enabled: false

That should be it.

Maintainers

NameEmailUrl
Mya Pitzerusehttps://mya.sh

Source Code

Values

KeyTypeDefaultDescription
affinityobject{}Specify affinity rules for the pods.
autoscaling.enabledboolfalseEnable autoscaling for the deployment.
autoscaling.maxReplicasint100Specify the maximum number of replicas.
autoscaling.minReplicasint1Specify the minimum number of replicas.
autoscaling.targetCPUUtilizationPercentageint80Specify the percent CPU utilization that causes the pods to autoscale.
cluster.enabledbooltrueEnable the Envoy cluster.
cluster.image.pullPolicystring"IfNotPresent"The pull policy used when pulling the Envoy proxy.
cluster.image.repositorystring"envoyproxy/envoy"The repository hosting the Envoy proxy.
cluster.image.tagstring"v1.29-latest"The version of Envoy to run.
config.data.appendOnlyFile.enabledboolfalseWhether to enable an append-only file.
config.data.appendOnlyFile.fsyncstring"everysec"When fsyncs should occur when using an append-only file.
config.data.directorystring""Where the append-only file and snapshots should be stored.
config.data.snapshot.compressionbooltrueCompress the snapshot.
config.data.snapshot.enabledboolfalseWhether to enable snapshots.
config.data.snapshot.scheduleslist[[3600,1],[300,100],[60,10000]]When to take a snapshot. [ seconds, key changes ]
config.databasesint1How many databases to make available.
config.maxMemory.evictionPolicystring"allkeys-lru"The eviction policy to use when the maximum memory is reached or exceeded.
config.maxMemory.sizestring""The number of bytes representing the maximum amount of memory that can be consumed.
config.passwordstring""Specify the password used for authentication.
config.usernamestring""Specify the username used for authentication.
externalConfig.secretRef.namestring""Specify the name of the secret containing the raw configuration.
extraVolumeMountslist[]Add additional volume mounts to the pod.
extraVolumeslist[]Add additional volumes to the pod.
fullnameOverridestring""Override the full name of the release.
image.pullPolicystring"IfNotPresent"The pull policy to use for the image.
image.repositorystring"img.pitz.tech/mya/redis"The repository hosting the image.
image.tagstring"6.2.7-alpine"Overrides the image tag whose default is the chart appVersion.
imagePullSecretslist[]Specify the secret containing the registry credentials.
kindstring"Deployment"Configure how the redis cluster will be deployed. This can be Deployment, DaemonSet, or StatefulSet.
metrics.serviceMonitor.enabledboolfalseAdd a Prometheus ServiceMonitor that scrapes the service.
metrics.serviceMonitor.intervalstring"10s"How frequently Prometheus should pull metrics from the service.
nameOverridestring""Override the name of the release.
nodeSelectorobject{}Specify the node selector used to control which nodes pods are deployed to.
podAnnotationsobject{}Annotations to add to the pod, typically used for assume roles.
podSecurityContextobject{}Specify the security context for the entire pod.
replicaCountint1The number of redis instances to deploy.
resourcesobject{}Specify the resources for the pod.
securityContextobject{}Specify the security context for the redis container.
serviceAccount.annotationsobject{}Annotations to add to the service account.
serviceAccount.createbooltrueSpecifies whether a service account should be created.
serviceAccount.namestring""The name of the service account to use. If not set and create is true, a name is generated using the fullname template.
tolerationslist[]Specify taints that the pods are willing to tolerate.
updateStrategyobject{}Configure the update strategy to use.
volumeClaimTemplateslist[]When using a StatefulSet, persistent volume claim templates can be specified for writing data to disk.

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 v22.4.10 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