Adding resource manifests
The relevant resources for an Operator are important to package in a way that can be easily deployed and maintained. This includes the Operator's CRD, but also other resources such as ClusterRoles and the matching ServiceAccount for those Roles. However, the first step is to generate a CRD from the Go types defined in the previous section with the following:
$ make manifests
This command generates a CRD that is based on the API we just defined. That CRD is placed under config/crd/bases/operator.example.com_nginxoperators.yaml
. That CRD looks as follows:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
name: nginxoperators.operator.example.comspec:
group: operator.example.com
names:
kind: NginxOperator...