Inferensys

Glossary

Custom Resource Definition (CRD)

A Custom Resource Definition (CRD) is an extension of the Kubernetes API that allows users to define their own custom object types, enabling the management of domain-specific resources using native Kubernetes tooling.
Developer demonstrating multi-agent tool use, agent tool selection interface on laptop, casual tech demo moment.
KUBERNETES API EXTENSION

What is a Custom Resource Definition (CRD)?

A Custom Resource Definition (CRD) is the mechanism for extending the Kubernetes API to support domain-specific object types, enabling the management of custom resources using native `kubectl` commands and declarative workflows.

A Custom Resource Definition (CRD) is a Kubernetes API extension that allows developers to define new, custom object types tailored to their specific application or infrastructure needs. By registering a CRD, users instruct the Kubernetes API server to recognize and serve a new RESTful resource endpoint, effectively teaching the cluster to manage domain-specific state beyond built-in primitives like Pods or Services. This enables the declarative management of complex, stateful workloads using the same versioned, schema-validated API machinery that governs core resources.

Once a CRD is created, instances of that resource—called Custom Resources (CRs)—can be provisioned and their lifecycle managed by a Kubernetes Operator. The Operator runs a continuous reconciliation loop, comparing the observed state of the custom resource against its declared desired state and automatically executing corrective actions to remediate any drift. This pattern is foundational to Zero-Touch Provisioning in cloud-native telecom, where CRDs model network functions like 5G cores or RAN components, allowing the platform to autonomously deploy, scale, and heal complex infrastructure without manual intervention.

KUBERNETES API EXTENSIBILITY

Key Features of CRDs

Custom Resource Definitions extend the Kubernetes API to model domain-specific infrastructure, enabling telecom operators to manage RAN functions using native Kubernetes tooling and declarative reconciliation loops.

01

Declarative Schema Definition

A CRD defines a new RESTful API endpoint in Kubernetes by specifying an OpenAPI v3 schema. This schema enforces strict validation on the desired state of custom resources, ensuring that every instance of a network function—such as a distributed unit (DU) or centralized unit (CU)—conforms to a well-defined structural contract before it is persisted to etcd. The schema specifies required fields, data types, and immutable constraints, preventing configuration drift at the point of ingestion.

02

Custom Resource Lifecycle Management

Once a CRD is registered, users can create, read, update, and delete (CRUD) instances of the custom resource via kubectl or the API. Each instance represents a declarative intent for a specific domain object. The system tracks the resource's observed state through a status subresource, which is kept strictly separate from the desired spec. This separation is critical for implementing the reconciliation loop pattern, where a controller continuously drives the observed state toward the desired state.

03

Controller-Driven Reconciliation

A CRD becomes operationally powerful when paired with a Kubernetes Operator. The operator contains a control loop that watches for changes to custom resources and executes domain-specific logic to reconcile state. For example, an O-RAN operator might watch an ORANRU custom resource and automatically provision a physical radio unit. This pattern encodes human operational knowledge into software, enabling fully automated Day 0 and Day 2 operations for telecom infrastructure.

04

Versioning and Conversion

CRDs support multiple API versions simultaneously, allowing for the evolution of a resource's schema without breaking existing clients. A conversion webhook can be deployed to translate resources between versions on-the-fly. This is essential for telecom operators managing long-lived infrastructure, as it allows a network service descriptor to be upgraded from v1alpha1 to v1 while maintaining backward compatibility for all existing instances of the resource in the cluster.

05

Native RBAC Integration

Custom resources are fully integrated with Kubernetes' Role-Based Access Control (RBAC) system. Cluster administrators can define fine-grained permissions for each custom resource type, controlling which users or service accounts can create, modify, or delete specific network functions. This ensures that a team managing O-RAN Central Units cannot inadvertently modify resources belonging to the Distributed Unit team, enforcing a strict separation of concerns within a shared multi-tenant cluster.

06

Subresources for Status and Scale

CRDs can expose standard /status and /scale subresources. The status subresource enables a controller to write the current operational state of a resource without having permission to modify the user-defined spec, preventing feedback loops. The scale subresource allows a custom resource to be horizontally scaled using kubectl scale, integrating with the Horizontal Pod Autoscaler. This is used to dynamically adjust the capacity of cloud-native network functions based on real-time traffic load.

CRD ESSENTIALS

Frequently Asked Questions

Clear, technical answers to the most common questions about extending the Kubernetes API with Custom Resource Definitions.

A Custom Resource Definition (CRD) is a powerful Kubernetes API extension that allows you to define your own custom object types, effectively teaching Kubernetes to manage domain-specific resources alongside native ones like Pods and Deployments. Once a CRD is applied to a cluster, the Kubernetes API server instantly serves a new, RESTful, custom resource endpoint. You can then create instances of your custom resource (Custom Objects, or CRs) and manage them using standard kubectl commands. The CRD itself defines the schema, name, and scope of your new resource. To imbue these custom objects with real behavior, you typically deploy a Kubernetes Operator—a controller that runs a continuous reconciliation loop, watching the API server for changes to your custom resources and taking automated actions to drive the observed state toward the desired state you declared.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.