This Memcached operator is a simple example operator for the Operator SDK and includes some basic end-to-end tests.
- go version v1.13+.
- docker version 17.03+
- kubectl v1.14.1+
- operator-sdk
- Access to a Kubernetes v1.14.1+ cluster
- Create a namespace
kubectl create namespace my-name
- Edit Makefile and replace
default
with your namespace name. - Run the unit tests
make test-unit
. This will run using a mocked Kubernetes API. - Run the system tests
make test-e2e
. This will run using your real Kubernetes API. - Add the necessary functionality to
pkg/controllers/memcached/memcached_controller.go
to pass the tests.
Run the following command
$ go mod tidy
Instead of building and redeploying the operator on every code change you can run it locally by running:
$ make run
This enables quicker development iterations.
Build the Memcached operator image and push it to a registry:
$ oc project <my-namespace>
$ make imagestream-init
$ make build
$ kubectl apply -f ./deploy