Creating CRDs
While Helm is often used to create traditional Kubernetes resources, it can also be used to create CRDs and CRs. CRDs are used to define resources that are not native to the Kubernetes API. You may want to use this functionality to augment the abilities that Kubernetes provides. CRs are resources that implement the CRD’s specification. As a result, it’s important to ensure that a CRD is always created before the CRs that implement it.
Helm is able to ensure CRDs are created and registered to Kubernetes before CRs are included in a Helm chart when CRDs are included in the chart’s crds/
folder. All CRDs defined under this folder are created before those in templates/
.
An example crds/
folder is shown here:
crds/ my-custom-resource-crd.yaml
The my-custom-resource-crd.yaml
file may have the following contents:
apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: my-custom-resources.learnhelm...