A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://sdk.operatorframework.io/docs/building-operators/golang/quickstart below:

Quickstart for Go-based Operators | Operator SDK

Quickstart for Go-based Operators

A simple set of instructions to set up and run a Go-based operator.

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

Prerequisites Steps
  1. Create a project directory for your project and initialize the project:
mkdir memcached-operator
cd memcached-operator
operator-sdk init --domain example.com --repo github.com/example/memcached-operator

Note If your local environment is Apple Silicon (darwin/arm64) use the go/v4 plugin which provides support for this platform by adding to the init subCommand the flag --plugins=go/v4

  1. Create a simple Memcached API:
operator-sdk create api --group cache --version v1alpha1 --kind Memcached --resource --controller
  1. Build and push your operator’s image:
make docker-build docker-push IMG="example.com/memcached-operator:v0.0.1"
OLM deployment
  1. Install OLM:
  1. Bundle your operator, then build and push the bundle image (defaults to example.com/memcached-operator-bundle:v0.0.1):
make bundle IMG="example.com/memcached-operator:v0.0.1"
make bundle-build bundle-push BUNDLE_IMG="example.com/memcached-operator-bundle:v0.0.1"
  1. Run your bundle. If your bundle image is hosted in a registry that is private and/or has a custom CA, these configuration steps must be complete.
operator-sdk run bundle <some-registry>/memcached-operator-bundle:v0.0.1
  1. Create a sample Memcached custom resource:
$ kubectl apply -f config/samples/cache_v1alpha1_memcached.yaml
memcached.cache.example.com/memcached-sample created
  1. Uninstall the operator:
operator-sdk cleanup memcached-operator
Direct deployment
  1. Deploy your operator:
make deploy IMG="example.com/memcached-operator:v0.0.1"
  1. Create a sample Memcached custom resource:
$ kubectl apply -f config/samples/cache_v1alpha1_memcached.yaml
memcached.cache.example.com/memcached-sample created
  1. Uninstall the operator:
Run locally (outside the cluster)

This is recommended ONLY for development purposes

  1. Run the operator:
  1. In a new terminal tab/window, create a sample Memcached custom resource:
$ kubectl apply -f config/samples/cache_v1alpha1_memcached.yaml
memcached.cache.example.com/memcached-sample created
  1. Stop the operator by pressing ctrl+c in the terminal tab or window the operator is running in
Next Steps

Read the full tutorial for an in-depth walkthrough of building a Go operator.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4