Quickstart for Ansible-based Operators

    This guide walks through an example of building a simple memcached-operator powered by Ansible using tools and libraries provided by the Operator SDK.

    Create and change into a directory for your project. Then call operator-sdk init with the Ansible plugin to initialize the :

    Create an API

    Let’s create a new API with a role for it:

    1. operator-sdk create api --group cache --version v1 --kind Memcached --generate-role

    NOTE: To allow the cluster pull the image the repository needs to be set as public or you must configure an image pull secret.

    Run the operator

    Install the CRD and deploy the project to the cluster. Set IMG with make deploy to use the image you just pushed:

    1. make install

    Create a sample CR:

    1. kubectl logs deployment.apps/memcached-operator-controller-manager -n memcached-operator-system -c manager

    Clean up

    Delete the CR to uninstall memcached:

    Use make undeploy to uninstall the operator and its CRDs:

    1. make undeploy

    Read the for an in-depth walkthough of building a Ansible operator.