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_PORTx.x.x.x:6379>
- List keys
x.x.x.x:6379> KEYS *
Upgrading from an existing version
upgrade helm if possible.
It's always recommended to
- 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 a8.x.x
version. The standardhelm upgrade
is not going to work, so the old chart and has to removed and then the new chart has to be installed. The accompanyingpvc(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 followinghelm value
file as save it asdev.yaml
.
cluster:enabled: trueslaveCount: 1usePassword: falseserviceAccount:create: truename: redisrbac:create: truerole:rules:- apiGroups:- extensionsresources:- podsecuritypoliciesverbs:- useresourceNames:- gce.unprivilegedslave:persistence:enabled: truepath: /bitnami/redis/datastorageClass: fastsize: 15Gimaster:persistence:enabled: truepath: /bitnami/redis/datastorageClass: fastsize: 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 redis5.0.9
.
Fresh install
Use the above helm value file.
$_> helm install redis --namespace dictybase -f dev.yaml bitnami/redis --version 10.6.12