This example project implements a controller for ConfigMapCount CRD, which looks like this:
apiVersion: silly.example.org/v1alpha1
kind: ConfigMapCount
metadata:
name: configmapcount-sample
namespace: default
status:
configMaps: 3This ((not) very useful) API object counts ConfigMaps in the same namespace and puts the count into
its .status.configMaps
field.
Have your Kubernetes cluster ready. One great option is kind:
If you made any changes to API types, you need to generate Go and CRD YAML code:
make generateTo install the CRDs into your Kubernetes cluster:
make installRun against the configured Kubernetes cluster in ~/.kube/config
make run