redis
Open source, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.
About this chart
Redis
Redis is an advanced key-value cache and store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets, sorted sets, bitmaps and hyperloglogs.
TL;DR
# Testing configuration
$ helm install <helm-repo>/redis
$ helm install stable/redis
# Production configuration
$ helm install <helm-repo>/redis --values values-production.yaml
$ helm install stable/redis --values values-production.yaml
Introduction
This chart bootstraps a Redis deployment on a Kubernetes cluster using the Helm package manager.
Bitnami charts can be used with Kubeapps for deployment and management of Helm Charts in clusters. This chart has been tested to work with NGINX Ingress, cert-manager, fluentd and Prometheus on top of the BKPR.
Prerequisites
- Kubernetes 1.8+
- PV provisioner support in the underlying infrastructure
Installing the Chart
To install the chart with the release name my-release:
$ helm install --name my-release <helm-repo>/redis
$ helm install --name my-release stable/redis The command deploys Redis on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.
Tip: List all releases using
helm list
Uninstalling the Chart
To uninstall/delete the my-release deployment:
$ helm delete my-release
The command removes all the Kubernetes components associated with the chart and deletes the release.
Upgrading an existing Release to a new major version
A major chart version change (like v1.2.3 -> v2.0.0) indicates that there is an incompatible breaking change needing manual actions.
To 7.0.0
This version causes a change in the Redis Master StatefulSet definition, so the command helm upgrade would not work out of the box. As an alternative, one of the following could be done:
- Recommended: Create a clone of the Redis Master PVC (for example, using projects like this one). Then launch a fresh release reusing this cloned PVC.
helm install <helm-repo>/redis --set persistence.existingClaim=<NEW PVC>
helm install stable/redis --set persistence.existingClaim=
- Alternative (not recommended, do at your own risk):
helm delete --purgedoes not remove the PVC assigned to the Redis Master StatefulSet. As a consequence, the following commands can be done to upgrade the release
helm delete --purge <RELEASE>
helm install <helm-repo>/redis --name <RELEASE>
helm install stable/redis --name
Previous versions of the chart were not using persistence in the slaves, so this upgrade would add it to them. Another important change is that no values are inherited from master to slaves. For example, in 6.0.0 slaves.readinessProbe.periodSeconds, if empty, would be set to master.readinessProbe.periodSeconds. This approach lacked transparency and was difficult to maintain. From now on, all the slave parameters must be configured just as it is done with the masters.
Some values have changed as well:
master.portandslave.porthave been changed toredisPort(same value for both master and slaves)master.securityContextandslave.securityContexthave been changed tosecurityContext(same values for both master and slaves)
By default, the upgrade will not change the cluster topology. In case you want to use Redis Sentinel, you must explicitly set sentinel.enabled to true.
To 6.0.0
Previous versions of the chart were using an init-container to change the permissions of the volumes. This was done in case the securityContext directive in the template was not enough for that (for example, with cephFS). In this new version of the chart, this container is disabled by default (which should not affect most of the deployments). If your installation still requires that init container, execute helm upgrade with the --set volumePermissions.enabled=true.
To 5.0.0
The default image in this release may be switched out for any image containing the redis-server
and redis-cli binaries. If redis-server is not the default image ENTRYPOINT, master.command
must be specified.
Breaking changes
master.argsandslave.argsare removed. Usemaster.commandorslave.commandinstead in order to override the image entrypoint, ormaster.extraFlagsto pass additional flags toredis-server.disableCommandsis now interpreted as an array of strings instead of a string of comma separated values.master.persistence.pathnow defaults to/data.
4.0.0
This version removes the chart label from the spec.selector.matchLabels
which is immutable since StatefulSet apps/v1beta2. It has been inadvertently
added, causing any subsequent upgrade to fail. See https://github.com/helm/charts/issues/7726.
It also fixes https://github.com/helm/charts/issues/7726 where a deployment extensions/v1beta1 can not be upgraded if spec.selector is not explicitly set.
Finally, it fixes https://github.com/helm/charts/issues/7803 by removing mutable labels in spec.VolumeClaimTemplate.metadata.labels so that it is upgradable.
In order to upgrade, delete the Redis StatefulSet before upgrading:
$ kubectl delete statefulsets.apps --cascade=false my-release-redis-master
And edit the Redis slave (and metrics if enabled) deployment:
kubectl patch deployments my-release-redis-slave --type=json -p='[{"op": "remove", "path": "/spec/selector/matchLabels/chart"}]'
kubectl patch deployments my-release-redis-metrics --type=json -p='[{"op": "remove", "path": "/spec/selector/matchLabels/chart"}]'
Configuration
The following table lists the configurable parameters of the Redis chart and their default values.
| Parameter | Description | Default |
|---|---|---|
global.imageRegistry | Global Docker image registry | nil |
global.imagePullSecrets | Global Docker registry secret names as an array | [] (does not add image pull secrets to deployed pods) |
image.registry | Redis Image registry | docker.io |
image.repository | Redis Image name | bitnami/redis |
image.tag | Redis Image tag | {VERSION} |
image.pullPolicy | Image pull policy | Always |
image.pullSecrets | Specify docker-registry secret names as an array | nil |
cluster.enabled | Use master-slave topology | true |
cluster.slaveCount | Number of slaves | 1 |
existingSecret | Name of existing secret object (for password authentication) | nil |
usePassword | Use password | true |
usePasswordFile | Mount passwords as files instead of environment variables | false |
password | Redis password (ignored if existingSecret set) | Randomly generated |
configmap | Redis configuration file to be used | See values.yaml |
clusterDomain | Kubernetes DNS Domain name to use | cluster.local |
networkPolicy.enabled | Enable NetworkPolicy | false |
networkPolicy.allowExternal | Don't require client label for connections | true |
securityContext.enabled | Enable security context (both redis master and slave pods) | true |
securityContext.fsGroup | Group ID for the container (both redis master and slave pods) | 1001 |
securityContext.runAsUser | User ID for the container (both redis master and slave pods) | 1001 |
serviceAccount.create | Specifies whether a ServiceAccount should be created | false |
serviceAccount.name | The name of the ServiceAccount to create | Generated using the fullname template |
rbac.create | Specifies whether RBAC resources should be created | false |
rbac.role.rules | Rules to create | [] |
metrics.enabled | Start a side-car prometheus exporter | false |
metrics.image.registry | Redis exporter image registry | docker.io |
metrics.image.repository | Redis exporter image name | oliver006/redis_exporter |
metrics.image.tag | Redis exporter image tag | v0.31.0 |
metrics.image.pullPolicy | Image pull policy | `IfNotPresent |
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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartredis is pinned at v8.0.1 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