Custom mem-cached operator for Kubernetes.
An Operator is a method of packaging, deploying and managing a Kubernetes application.
A Kubernetes application is an application that is both deployed on Kubernetes and managed using the Kubernetes APIs and kubectl tooling.
Pre-requisites:
-
GoLang
- Set the name of the operator in an environment variable
export OPERATOR_NAME=memcached-operator
- Run locally
operator-sdk up local --namespace=default
- Regenerate K8s related code
operator-sdk generate k8s
- Docker build
operator-sdk build mwrona/k8s-memcached-operator:v0.0.1
- Docker push
docker push mwrona/k8s-memcached-operator:v0.0.1
- Deploy K8s operator
kubectl create -f deploy/crds/cache_v1alpha1_memcached_crd.yaml
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
- Create mem-cached
kubectl apply -f deploy/crds/cache_v1alpha1_memcached_cr.yaml
- Check mem-cached status
kubectl get memcached/example-memcached -o yaml