A golang based redis operator which will make/oversee Redis standalone/cluster mode setup on top of the Kubernetes.
The purpose of creating this operator was to provide an easy and production grade setup of Redis on Kubernetes. It doesn't care if you have a plan Kubernetes, a Cloud based.
Here the features which are supported by this operator:-
- Redis cluster/standalone mode setup
- Inbuilt monitoring with prometheus exporter
- Dynamic storage provisioning with pvc template
- Resources restrictions with k8s requests and limits
- Password/Password-less setup
- Node selector and affinity
- Priority class to manage setup priority
- SecurityContext to manipulate kernel parameters
If you want to deploy redis-operator from scratch to a local Minikube cluster, begin with the Getting started document. It will guide your through the setup step-by-step.
The configuration of Redis setup should be described in Redis CRD. You will find all the examples manifests in example folder.
Redis operator requires a Kubernetes cluster of version >=1.8.0
. If you have just started with Operators, its highly recommended to use latest version of Kubernetes.
The setup can be done by using helm. If you want to see more example, please go through the example folder.
But you can simply use the helm chart for installation.
# Deploy the redis-operator
helm upgrade redis-operator ./helm/redis-operator --install --namespace redis-operator
After deployment, verify the installation of operator
helm test redis-operator --namespace redis-operator
Creating redis cluster or standalone setup.
# Create redis cluster setup
helm upgrade redis-cluster ./helm/redis-setup --set redisSetup.setupMode="cluster" \
--set redisSetup.clusterSize=3 \
--install --namespace redis-operator
# Create redis standalone setup
helm upgrade redis ./helm/redis-setup --set redisSetup.setupMode="standalone" \
--install --namespace redis-operator
Other customizable values are present in values.yaml with description.
To monitor redis performance we will be using prometheus. In any case, extra prometheus configuration will not be required because we will be using the Prometheus service discover pattern. For that we already have set these annotations:-
annotations:
"redis.opstreelabs.in": "true"
"prometheus.io/scrape": "true"
"prometheus.io/port": "9121"
Please see our DEVELOPMENT.md for details.
Please see our CHNANGELOG.md for details.
Please see our GETTING_STARTED.md for details.
- Dynamic Configuration Update
- Add unit test cases
- Add circle ci pipeline integration
- Logging needs to be structured
- Fix permissions in role and rolebindings
- Refactor code as much as we can