Manual CRD Management(4.0)

Need for manual CRD management

If the user that executes the helm install/upgrade command does not have cluster level permissions to create/update CustomResourceDefinitions (CRDs), the CRD lifecycle needs to be managed manually outside the helm chart.

Obtaining the CRD yaml

The CRD yaml to apply can be obtained by the use of the helm template command. When executing this command, it is important that it is executed using the same helm values as when executing the helm install/upgrade command. With one important difference, namely that the operator.installCRDs value must be set to true. The output should also be redirected to an arbitrary file.

Example:

$ helm template my-usage-engine <usage engine helm chart> -f my-values.yaml --set operator.installCRDs=true > my-usage-engine.yaml


Now open up the resulting file (my-usage-engine.yaml in this example) in your favorite yaml editor and locate the usage-engine-private-edition/charts/usage-engine-private-edition-operator/templates/uepe-operator-crds.yaml source. Copy this yaml source all the way down to the next --- delimiter and save it to a new file (for instance, uepe-operator-crds.yaml).

Applying the CRD Manually

Execute the following command to manually apply the CRD yaml obtained in the previous step:

$ kubectl apply -f uepe-operator-crds.yaml

Installing/Upgrading Helm Chart

Now the helm install/upgrade command can be executed as per the normal procedure, with one significant difference, namely that the operator.installCRDs value must be set to false. Example:

$ helm upgrade my-usage-engine <usage engine helm chart> -f my-values.yaml --set operator.installCRDs=false