What is the best way to deploy the Redis cluster

1,183 views
Skip to first unread message

Guangya Liu

unread,
Jul 19, 2017, 9:37:30 PM7/19/17
to Kubernetes user discussion and Q&A
Hi,

I found that there are two ways to deploy a Redis cluster, one is in openshift, it is using statefulset https://github.com/openshift/origin/blob/master/examples/statefulsets/redis/redis.yaml

And another is in Kuberntes helm charts, it is using Deployment + Service to deploy the Redis cluster https://github.com/kubernetes/charts/tree/master/stable/redis/templates

Using statefulset can make sure the hostname of redis will never change even after redis restart, and the application can always use hostname to access redis.

Using deployment and service can enable other applications using service to access the redis, which also works even after the redis restart.

Does there are any recommendations for which one is better, or this depend on user scenarios?

Thanks,

Guangya

Rodrigo Campos

unread,
Jul 19, 2017, 11:35:23 PM7/19/17
to kubernet...@googlegroups.com
If you use redis without persistency, probably a deployment is fine.

Stateful sets are newer, and might help you (didn't look at the yaml) to manage persistency in redis (and redis upgraded, etc.) More easily
--
You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-users+unsubscribe@googlegroups.com.
To post to this group, send email to kubernetes-users@googlegroups.com.
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.

Guang Ya Liu

unread,
Jul 20, 2017, 8:43:05 PM7/20/17
to kubernet...@googlegroups.com
Thanks Rodrigo!

But even with deployment, I can still have volume mounts in the deployment to mount to external storage, so even using deployment, I can still have persistency, right?

For statefulset, I can use volumeClaimTemplates to mount PVCs to have persistency, but how an it make upgrade easily? Also I can always rolling upgrade a Deployment for this case, comments?

Thanks,

Guangya

Guang Ya Liu

unread,
Jul 21, 2017, 7:32:13 PM7/21/17
to kubernet...@googlegroups.com, Kubernetes developer/contributor discussion
+ Kubernetes dev, hope can get more comments/suggestions here.

Thanks,

Guangya

Rodrigo Campos

unread,
Jul 23, 2017, 10:35:55 PM7/23/17
to kubernet...@googlegroups.com
You can specify a volume id, but then only have one replica. And, to deploy, then you need downtime.

With a PVC and something smarter, you might be able to do some more cool things.

But don't underestimate the power of simplicity, if it's enough for your use case :-)
Reply all
Reply to author
Forward
0 new messages