This repo contains the Mcrouter Ansible Operator. Mcrouter uses memcache as backend and the operator written for memcache deployment by Dylan Murray @dymurray helped as a reference for this. This operator was created using the Operator-SDK and is intended for PoC/small scale demos in their current form.
- minikube
- kubectl
- operator-sdk
eval $(minikube docker-env)
kubectl create -f deploy/crds/mcrouter_v1alpha2_mcrouter_crd.yaml
operator-sdk build mcrouter-operator:v0.0.1
kubectl create -f deploy/service_account.yaml
kubectl create -f deploy/role.yaml
kubectl create -f deploy/role_binding.yaml
kubectl create -f deploy/operator.yaml
You can change the pods to be deployed inside the files
kubectl create -f deploy/crds/mcrouter_v1alpha2_mcrouter_cr.yaml
Once everything is deployed you can use the
kubectl get all
command to check of mcrouter-operator and memcache and deployed mcrouter are working
Connect to mcrouter using the telnet container and send the following commands to see if you get expected output
kubectl run -it --rm telnet --image=jess/telnet --restart=Never <mcrouter_pod_ip> 5000
In the telnet prompt send below commands
set mykey 0 0 5
hello
get mykey
quit
Connect to memcached service using the telnet container and send the stats
command to see if it gives you output.
- https://www.ansible.com/blog/ansible-operator
- https://opensource.com/article/18/10/ansible-operators-kubernetes
- https://blog.openshift.com/reaching-for-the-stars-with-ansible-operator/
- https://github.com/Dev25/mcrouter-docker/
- https://itnext.io/a-practical-kubernetes-operator-using-ansible-an-example-d3a9d3674d5b
- https://github.com/helm/charts/tree/master/stable/mcrouter