Redis

Redis will be used for caching entries and it is installed from this chart.

Checking Redis data in the cluster

Use this process to check the status of data in the redis instance before and after any kind of upgrade.

  • Get a shell in kubernetes cluster.
kubectl run --rm -it --restart=Never -n dictybase redis-backup --image=redis:4-alpine3.10 /bin/sh
  • Login to the database
$_> redis-cli -h $REDIS_MASTER_SERVICE_HOST -p $REDIS_MASTER_SERVICE_PORT
x.x.x.x:6379>
  • List keys
x.x.x.x:6379> KEYS *

Upgrading from an existing version

  • Add helm repository for redis
$_> helm repo add bitnami https://charts.bitnami.com/bitnami
  • Check the current version of redis installed in the cluster ...
$_> helm ls redis
  • If the chart version is <7.0.0 then it has to be upgraded to a 8.x.x version. The standard helm upgrade is not going to work, so the old chart and has to removed and then the new chart has to be installed. The accompanying pvc(PersistentVolumeClaim) will not be removed and so no data will be destroyed with this upgrade. Make sure to check status of redis data after this upgrade. Use the following helm value file as save it as dev.yaml.
cluster:
enabled: true
slaveCount: 1
usePassword: false
serviceAccount:
create: true
name: redis
rbac:
create: true
role:
rules:
- apiGroups:
- extensions
resources:
- podsecuritypolicies
verbs:
- use
resourceNames:
- gce.unprivileged
slave:
persistence:
enabled: true
path: /bitnami/redis/data
storageClass: fast
size: 15Gi
master:
persistence:
enabled: true
path: /bitnami/redis/data
storageClass: fast
size: 15Gi
$_> helm delete redis --purge
$_> helm install --name redis --namespace dictybase -f dev.yaml bitnami/redis --version 8.1.5
  • Then simply upgrade to the 9.x and finally to the latest 10.x version. Though it is not really important to check the data after these upgrades, however make sure that the redis instance is in running state before performing the helm based upgrade.
$_> helm upgrade redis --namespace dictybase -f dev.yaml bitnami/redis --version 9.5.5
$_> helm upgrade redis --namespace dictybase -f dev.yaml bitnami/redis --version 10.6.12
  • The chart version 10.6.12 will install redis 5.0.9.

Fresh install

Use the above helm value file.

$_> helm install redis --namespace dictybase -f dev.yaml bitnami/redis --version 10.6.12