Create API operator-sdk create api --group cache --version v1alpha1 --kind Memcaches --plugins="deploy-image/v1-alpha" --image=memcached:1.4.36-alpine --image-container-command="memcached,-m=64,modern,-v" --run-as-user="1001"
Regenerate if any changes were done make generate
Update the CRD with the changes make manifest
Test locally while developing make install run
Upload the image docker login export IMG=docker.io/yasensim/memcached-operator:v0.0.1 kubectl config set-context --current --namespace=memcached-operator-system make docker-build IMG=$IMG make docker-push IMG=$IMG
Deploy the operator make deploy IMG=$IMG
Verify deployment kubectl get deploy,pods
Create Memcached CR and make sure it works
change cache_v1alpha1_memcaches.yaml to have 3 replicas kubectl apply -f config/samples/cache_v1alpha1_memcaches.yaml kubectl get deploy,pods
Delete the setup kubectl delete -f config/samples/cache_v1alpha1_memcaches.yaml make undeploy kubectl config set-context --current --namespace=default
Install OLM in the cluster (optional) operator-sdk olm install