This repository implements a simple controller for watching Foo resources as defined with a CustomResourceDefinition (CRD) following the behavioural contract of kubernetes/sample-controller but written in Rust.
This particular example demonstrates how to perform basic operations such as:
-
How to register a new custom resource (custom resource type) of type
Foousing a CustomResourceDefinition. -
How to create/get/list instances of your new resource type
Foo. -
How to setup a controller on resource handling create/update/delete events.
|
Note
|
Since the sample-controller uses apps/v1 deployments, the Kubernetes cluster version should be greater than 1.9. Only tested against 1.16
|
# create a CustomResourceDefinition
kubectl create -f artifacts/examples/crd.yaml
# assumes you have a working kubeconfig, not required if operating in-cluster
cargo run
# create a custom resource of type Foo
kubectl create -f artifacts/examples/example-foo.yaml
# check deployments created through the custom resource
kubectl get deployments