Skip to content

Latest commit

 

History

History
63 lines (57 loc) · 2.29 KB

README.md

File metadata and controls

63 lines (57 loc) · 2.29 KB

AnsOpDemo

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.

Instructions to Run

Requirements

  • minikube
  • kubectl
  • operator-sdk

Connect to minikube docker environment

eval $(minikube docker-env)

Create the custom resource definition for mcrouter

kubectl create -f deploy/crds/mcrouter_v1alpha2_mcrouter_crd.yaml

Build the mcrouter-operator docker image

operator-sdk build mcrouter-operator:v0.0.1

Create service account, role and role_bindings

kubectl create -f deploy/service_account.yaml
kubectl create -f deploy/role.yaml
kubectl create -f deploy/role_binding.yaml

Deploy the Operator

kubectl create -f deploy/operator.yaml

Create the custom resources for mcrouter

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

Use the below testing scenario to check if mcrouter and memcached are working as expected

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.

Helpful articles and referenced content below: