Quickstart for Ansible-based Operators
- Create a project directory for your project and initialize the project:
- Create a simple Memcached API:
- Use the built-in Makefile targets to build and push your operator. Make sure to define
IMG
when you call make
:
export OPERATOR_IMG="quay.io/example/memcached-operator:v0.0.1"
- Install :
- Bundle your operator and push the bundle image:
make bundle IMG=$OPERATOR_IMG
# Note the "-bundle" component in the image name below.
export BUNDLE_IMG="quay.io/example/memcached-operator-bundle:v0.0.1"
make bundle-build BUNDLE_IMG=$BUNDLE_IMG
- Run your bundle:
operator-sdk run bundle $BUNDLE_IMG
- Create a sample Memcached custom resource:
- Uninstall the operator:
operator-sdk cleanup memcached-operator
Direct deployment
- Deploy your operator:
make deploy IMG=$OPERATOR_IMG
- Create a sample Memcached custom resource:
- Uninstall the operator: