A CustomResourceDefinition (CRD) extends the Kubernetes API with a new custom resource type. After installing a CRD, the cluster accepts objects with that kind, just as it accepts built-in Kubernetes objects. section 16.4.1
CRDs support several practical workflows:
- Install Gateway API CRDs before creating Gateway API resources; choose the standard channel for stable resources or the experimental channel for resources and fields that may change. section 13.1.2 section 13.1.3
- Define an application-specific type such as MongoDBCommunity, which can represent a desired MongoDB deployment through familiar apiVersion, kind, metadata, and spec fields. section 16.4.1 section 16.4.2
- Remove the type by deleting its CRD after deleting the related custom resource and operator resources. section 16.4.3
Creating a MongoDB custom type
Apply the operator's CRD manifest with kubectl apply -f config/crd/bases/mongodbcommunity.mongodb.com_mongodbcommunity.yaml. The cluster then recognizes kind MongoDBCommunity. Applying a MongoDBCommunity object lets the operator reconcile the desired configuration into a StatefulSet, Services, and Secrets; the operator restores its desired state if those generated objects are changed directly. section 16.4.2
$ kubectl apply -k github.com/kubernetes-sigs/gateway-api/config/crd/experimental customresourcedefinition/gatewayclasses.gateway.networking.k8s.io created customresourcedefinition/gateways.gateway.networking.k8s.io created ...
Shows the kubectl command that installs Gateway API CRDs from the experimental channel and the resulting resource creation. section 13.1.3






