Quickstart for Go-based Operators

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

    1. Create a project directory for your project and initialize the project:
    1. Create a simple Memcached API:
      1. Use the built-in Makefile targets to build and push your operator. Make sure to define IMG when you call make:
      1. export USERNAME=<quay-namespace>
      2. export OPERATOR_IMG="quay.io/$USERNAME/memcached-operator:v0.0.1"
      3. make docker-build docker-push IMG=$OPERATOR_IMG

      SHELL := /bin/bash

      1. Install :
      1. Bundle your operator and push the bundle image:
      1. make bundle IMG=$OPERATOR_IMG
      2. export BUNDLE_IMG="quay.io/$USERNAME/memcached-operator-bundle:v0.0.1"
      3. make docker-push IMG=$BUNDLE_IMG
      1. Run your bundle:
      1. operator-sdk run bundle $BUNDLE_IMG
      1. Create a sample Memcached custom resource:
      1. Uninstall the operator:
      1. operator-sdk cleanup memcached-operator

      Direct deployment

      1. Deploy your operator:
      1. make deploy IMG=$OPERATOR_IMG
      1. Create a sample Memcached custom resource:

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