Skip to content

How to Clone a Redis Helm Release on OpenShift

Blog | 08.16.2019 | 4 min read

Jagadish Mukku, Technical Director

Jagadish Mukku is a technical director leading the Data Protection and Cloud Mobility at He played a key role in architecting the ROBIN platform enterprise storage stack that powers data protection, cloud mobility, life cycle management of databases and data intensive applications. Prior to, he was a Senior Architect at Violin Systems known for delivering the industry's first million iops in a 4U All Flash Array. He has been in the storage industry for 19 years starting his career in Veritas and built products in scale out storage, distributed systems, and file systems throughout his career.

  • Share on Twitter
  • Share on Linked In
  • Share on Facebook
  • Email this blog post

In this tutorial, we will create a clone of the Redis database that is deployed on OpenShift. We will then make changes to the clone and verify that the original database has remained unaffected by changes that were done to the clone.

Before you begin this tutorial, make sure you have installed Robin Storage on your existing OpenShift cluster, your Redis database is deployed on OpenShift, has data loaded in it, and the Helm release is registered with Robin and you have taken a snapshot of your deployed Redis database.

How to Clone a Redis Database on OpenShift

Robin lets you clone not just the storage volumes (PVCs) but the entire database application including all its resources such as Pods, StatefulSets, PVCs, Services, ConfigMaps, etc. with a single command.

Application cloning improves the collaboration across Dev/Test/Ops teams. Teams can share app+data quickly, reducing the procedural delays involved in re-creating environments. Each team can work on their clone without affecting other teams. Clones are useful when you want to run a report on a database without affecting the source database application, or for performing UAT tests or for validating patches before applying them to the production database, etc.

Robin clones are ready-to-use “thin copy” of the entire app/database, not just storage volumes. Thin-copy means that data from the snapshot is NOT physically copied, therefore clones can be made very quickly. Robin clones are fully-writable and any modifications made to the clone are not visible to the source app/database.

To create a clone from the existing Redis database snapshot created earlier, run the following command. Use the snapshot id from the snapshot tutorial.

[robinds@centos-60-76 ~]# robin clone create empapp-clone Your_Snapshot_ID --wait

Let’s verify Robin has cloned all relevant Kubernetes resources. You should see an output similar to below.

Notice that Robin automatically clones all the required Kubernetes resources, not just storage volumes (PVCs), that are required to stand up a fully-functional clone of our database. After the clone is complete, the cloned database is ready for use.

Get Service IP address of our Redis database clone, and note the IP address.

export SERVICE_IP=$(oc get svc --namespace default empapp-clone-employees-redis-master --template "{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}")

Get Password of our Redis store clone from Kubernetes Secret.

export REDIS_PASSWORD=$(oc get secret --namespace default empapp-clone-employees-redis -o jsonpath="{.data.redis-password}" | base64 --decode)

To verify we have successfully created a clone of our Redis database, run the following command.

redis-cli -h $SERVICE_IP -a $REDIS_PASSWORD hvals employees

You should see an output similar to the following with 9 employee records.

We have successfully created a clone of our original Redis store, and the cloned store also has a hash called “employees” with 9 records, just like the original.

Now, let’s make changes to the clone and verify the original store remains unaffected by changes to the clone. Let’s delete the employee entry  “e000005”.

redis-cli -h $SERVICE_IP -a $REDIS_PASSWORD hdel employees e000005

Let’s verify the movie has been deleted.

mysql -h $IP_ADDRESS -u root -p$MYSQL_PASSWORD testdb -e "SELECT * from movies;"

You should see an output similar to the following with 8 employees with “Janay Jacobi” deleted.

Now, let’s connect to our original Redis store and verify it is unaffected.

Get Service IP address of our original Redis store.

export REDIS_PASSWORD=$(oc get secret --namespace redis-tutorial employees-redis -o jsonpath="{.data.redis-password}" | base64 --decode)

Get Password of our original Redis store from Kubernetes Secret.

export SERVICE_IP=$(oc get svc --namespace redis-tutorial employees-redis-master --template "{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}")

To verify that our Redis store is unaffected by changes to the clone, run the following command. Let’s connect to “employees” and check the record.

redis-cli -h $SERVICE_IP -a $REDIS_PASSWORD hvals employees

You should see an output similar to the following, with all 9 employee records present.

This means we can work on the original Redis store and the cloned database simultaneously without affecting each other. This is valuable for collaboration across teams where each team needs to perform a unique set of operations.

This concludes the Clone Redis on OpenShift tutorial.

Related Posts​