Using Helm to manage operators, CRDs, and CRs
In this chapter, we installed the Guestbook operator and CRD by using the Makefile
instance generated by operator-sdk
. Then, we installed a Guestbook CR using kubectl apply
. While this is an acceptable way of creating these resources, we could also install the operator, CRD, and CR by using Helm charts to provide a more repeatable solution for installing and managing an operator.
Helm allows you to create CRDs by adding them to a directory called crds/
in your Helm chart. Helm creates CRDs before any of the other resources defined under the templates/
folder, making it simpler to install applications such as operators that depend on CRDs.
The following file structure depicts a Helm chart that could be used to install the Guestbook operator:
guestbook-operator/ Chart.yaml crds/ guestbooks_crd.yaml templates/ deployment.yaml ...