# Packages
No description provided by the author
# README
Sample Controller
Go version
Spec
Sample Controller manages a custom resource Foo
to keep a Deployment
always running for a Foo
instance.
- Group:
example.com
- CR:
Foo
- Version:
v1alpha1
Docs
https://nakamasato.github.io/sample-controller
local:
git submodule update --init --recursive
hugo serve
Open: http://localhost:1313/sample-controller/
Quickstart
-
Install CRD.
kubectl apply -f config/crd/foos.yaml
-
Start controller.
go run .
-
Create CR.
kubectl apply -f config/sample/foo.yaml
-
Check.
kubectl get deploy NAME READY UP-TO-DATE AVAILABLE AGE foo-sample 1/1 1 1 103s
-
Clean up.
- Delete CR.
kubectl delete -f config/sample/foo.yaml
- Stop controller.
- Delete CRD.
kubectl delete -f config/crd/foos.yaml
- Delete CR.
Tools
Reference
- sample-controller
- Kubernetes Deep Dive: Code Generation for CustomResources
- Generating ClientSet/Informers/Lister and CRD for Custom Resources | Writing K8S Operator - Part 1
- Implementing add and del handler func and token field in Kluster CRD | Writing K8S Operator - Part 2
- Calling DigitalOcean APIs on Kluster's add event | Writing K8S Operator - Part 3
- A deep dive into Kubernetes controllers
- Programming Kubernetes CRDs