Upgrade
Note
Whichever approach you take to upgrading Redis Operator, make sure to test it in your development environment before applying it to production.Version-Specific Migration Guides
Before upgrading, check if there is a migration guide for your version jump. These guides cover breaking changes and required manual steps.
| From | To | Guide |
|---|---|---|
| v0.23.0 | v0.24.0 | Migration Guide |
Upgrading Operator
The following are strategies for safely upgrading Redis Operator from one version to another. They may require adjustment to your particular architecture but should provide a solid foundation for updating safely.
Ideally we should disable the reconcillation on all the Redis setup managed by operator. To disable the reconcillation, we need to add an annotation on all the Redis and Redis Cluster object.
For Redis standalone object:
annotations:
redis.opstreelabs.in/skip-reconcile: "true"
For RedisCluster object:
annotations:
rediscluster.opstreelabs.in/skip-reconcile: "true"
For RedisReplication object:
annotations:
redisReplication.opstreelabs.in/skip-reconcile: "true"
For RedisSentinel object:
annotations:
redisSentinel.opstreelabs.in/skip-reconcile: "true"
Preserving existing PVC names
The name of the volume claim template in the generated StatefulSet defaults to the StatefulSet name, which gives PVCs such as redis-redis-0 for a standalone Redis named redis, and redis-cluster-leader-redis-cluster-leader-0 for a RedisCluster. If an older operator version created your PVCs under a different template name, a new StatefulSet will not adopt them and Redis starts on an empty volume.
Set OPERATOR_STS_PVC_TEMPLATE_NAME on the operator deployment to keep the previous template name:
spec:
containers:
- command:
- /manager
env:
- name: OPERATOR_STS_PVC_TEMPLATE_NAME
value: "<existing template name>"
The variable is global to the operator, so every managed setup uses the same template name. Leave it unset unless you are carrying PVCs over from an older layout.
Upgrading with Helm
Helm features capabilities for upgrading to newer versions without having to uninstall Redis Operator completely.
For details on how to use Helm for upgrades, see the helm upgrade documentation.
$ helm install redis-operator ot-helm/redis-operator \
--namespace ot-operators --version <desired_version>
Once upgrading activity is completed, again validate the setup by steps defined in Validation.
Upgrading with YAML
If you installed Redis Operator with install-operator.sh, we need to update the image tag version inside the deployment manifest of operator and again run the same script.
spec:
securityContext:
runAsNonRoot: true
containers:
- command:
- /manager
args:
- --leader-elect
- --zap-log-level=info
image: quay.io/opstree/redis-operator:<desired_version>
imagePullPolicy: Always
$ bash install-operator.sh