Custom Resource Definitions

    When working with Custom Resource Definitions (CRDs), it is important to distinguish two different pieces:

    • Then there are resources that use the CRD. Say a CRD defines foo.example.com/v1. Any resource that has and kind Foo is a resource that uses the CRD.

    Helm is optimized to load as many resources into Kubernetes as fast as possible. By design, Kubernetes can take an entire set of manifests and bring them all online (this is called the reconciliation loop).

    For a CRD, the declaration must be registered before any resources of that CRDs kind(s) can be used. And the registration process sometimes takes a few seconds.

    One way to do this is to put the CRD definition in one chart, and then put any resources that use that CRD in another chart.

    Method 2: Crd-install Hooks

    To package the two together, add a hook to the CRD definition so that it is fully installed before the rest of the chart is executed.

    Note that if you create the CRD with a crd-install hook, that CRD definition will not be deleted when is run.