I want to have 50 instance of redis, can I achieve this using docker-compose ? or should I use Kuberneties instead ? the point here is I want each instance has its own port and its own volume.
another question is how I can distribute the instances between multiple hosts, for example each 10 container will be host it on different server. (docker-swarm or Kuberneties ?)
2
Answers
Kubernetes would fit your use case. I would use the Helm chart from the stable:
https://hub.helm.sh/charts/bitnami/redis/6.4.0
Invest some time in the kubernetes as then you get so much for free. Redis would be a Statefulset in Kubernetes and you can scale it as you like if you have the resources.
In many cloud providers Redis should be an out of the box Application:
A statefulset garantees that each instance uses its own data volume.
https://www.digitalocean.com/docs/databases/redis/how-to/create/
Have fun!
as mention in above answer, you can definitely use the helm chart however you can also use the operator in Kubernetes.
Redis operator : https://github.com/spotahome/redis-operator
The operator gives you extra functionality and manages Redis cluster.
in Kubernetes you can use HA helm redis chart and scale it with stateful sets which is backed by PVC.
PVC knows as persistence volume claim which will be storing redis
.rdb
snapshot and.aof
appendonly
file.