Documentation
¶
Overview ¶
Package customresourcesgate implements a CustomResourceReconciler to report GKVs status to a Gate. This reconciler requires cluster scoped GET,LIST,WATCH on customresourcedefinitions[apiextensions.k8s.io]
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Setup ¶
func Setup(mgr ctrl.Manager, o controller.Options) error
Setup adds a controller that reconciles CustomResourceDefinitions to support delayed start of controllers. o.Gate is expected to be something like *gate.Gate[schema.GroupVersionKind].
func TransformStripCRDSchema ¶ added in v2.3.4
TransformStripCRDSchema is a cache.TransformFunc that removes heavy fields from CustomResourceDefinition objects before they are stored in the informer cache. It strips:
- Spec.Versions[].Schema (OpenAPI v3 validation schemas)
- ObjectMeta.ManagedFields
- The "kubectl.kubernetes.io/last-applied-configuration" annotation
This significantly reduces memory usage in clusters with many CRDs. The CRD gate reconciler only needs basic metadata (group, kind, version names, served status) and status conditions to function correctly.
Usage:
cache.Options{
ByObject: map[client.Object]cache.ByObject{
&apiextensionsv1.CustomResourceDefinition{}: {
Transform: customresourcesgate.TransformStripCRDSchema,
},
},
}
Types ¶
type Reconciler ¶
type Reconciler struct {
// contains filtered or unexported fields
}
Reconciler reconciles a CustomResourceDefinitions in order to gate and wait on CRD readiness to start downstream controllers.
func (*Reconciler) Reconcile ¶
func (r *Reconciler) Reconcile(_ context.Context, crd *apiextensionsv1.CustomResourceDefinition) (ctrl.Result, error)
Reconcile reconciles CustomResourceDefinitions and reports ready and unready GVKs to the gate.