Quickstart for Go-based Operators
About this tutorial
The original content is https://sdk.operatorframework.io/docs/building-operators/golang/quickstart/. In this tutorial, you can learn to create a go-based operator memcached-operator
with operator-sdk step by step.
What memcached-operator
does:
- Manage a custom resource Memcached
- spec.size
: specify the number of memcached nodes.
- status.nodes
: contain information about nodes.
- Implement the reconciliation loop in the controller
- Fetch Memcached instance
- Create Deployment if not exists
- Keep the Memcached's size and Deployment's replicas same
- Update status.nodes
with Pod's name.
Prerequisite
Install the followings:
operator-sdk
:v1.23.0
go
:1.18