Create a K8s CRD

Create a K8s CRD

February 4, 2021
Software
Tech, Storage

Create a K8s CRD #

This summarizes the tutorial referenced below & Knative Controllers as a quick review

Scafold the new CRD #

kubebuilder create api --group batch --version v1 --kind CronJob

Define The Object #

Look under {apis|api/v1}/{groupName}/{objectName}_types.go contains K8s Object.Spec and Object.Status

Update the Spec & Status sections

Add the Business Logic #

Implement the logic to convert desired state defined in the spec to the actual state reflected in the status.

This is done in the controller’s Reconcile function.

Knative #

  • The above guide is roughly the same with some caveats (TODO fill those out)

References