ajgrande924 / sandbox-operator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logo

@ajdev/sandbox-operator

Go Report Card Contributors Maintained Maintained

Table of Contents

Overview

The purpose of this project is to provide a reference kubernetes operator generated by operator-sdk. The latest kubernetes operator is generated by operator-sdk@1.0.1

Development

  • Instantiate project with operator-sdk:
# init project: all API groups will be <group>.ajdev.com
operator-sdk init --domain=ajdev.com --repo=github.com/ajgrande924/sandbox-operator

# create memcached api
operator-sdk create api --group cache --version v1 --kind Memcached --resource=true --controller=true
  • Update api and controller then update config assets:
# update generated code
make generate

# update manifests
make manifests
  • Build operator controller image:
# build / push operator controller image
make docker-build docker-push IMG=docker.io/ajgrande924/sandbox-operator:1.0.1
  • Install crd and controller to cluster:
make install
make deploy IMG=docker.io/ajgrande924/sandbox-operator:1.0.1
  • Apply custom resource and check:
kubectl apply -f config/samples/cache_v1_memcached.yaml 
kubectl logs deployment.apps/sandbox-operator-controller-manager -n default -c manager
  • Cleanup cluster:
kubectl delete -f config/samples/cache_v1_memcached.yaml
kubectl delete deployments,service -l control-plane=controller-manager
kubectl delete role,rolebinding --all

References

License

Sandbox Operator is under MIT license. See the LICENSE file for details.

About

License:MIT License


Languages

Language:Go 76.5%Language:Makefile 19.0%Language:Dockerfile 4.5%