A Custom Resource Definition (CRD) is a Kubernetes API extension mechanism that allows users to define new resource types, enabling the platform to manage custom objects as native first-class citizens. By creating a CRD, you introduce a new Custom Resource (CR), such as an InferenceService or LLMDeployment, which can be created, updated, and deleted using standard kubectl commands. The CRD itself is a schema that defines the structure, validation rules, and API endpoints for the new resource, effectively teaching the Kubernetes API server how to handle it.
Glossary
Custom Resource Definition (CRD)

What is Custom Resource Definition (CRD)?
A Custom Resource Definition (CRD) is a Kubernetes API extension mechanism that allows users to define new resource types, enabling the platform to manage custom objects as native first-class citizens.
The power of a CRD is realized when paired with a custom controller or Operator. This controller runs a reconciliation loop, watching for changes to instances of the custom resource and executing logic to align the actual cluster state with the desired state declared in the resource's spec. In LLM deployment and serving, CRDs are foundational for frameworks like KServe, allowing platform teams to define declarative APIs for complex inference services that the Operator then provisions and manages automatically.
Key Features of Custom Resource Definitions
Custom Resource Definitions (CRDs) are the fundamental building blocks for extending the Kubernetes API, allowing users to define and manage custom objects that represent their application's unique state and configuration.
API Extension Mechanism
A Custom Resource Definition (CRD) is a Kubernetes API extension that allows users to define new resource types (Kinds) and add them to the cluster's API server. Once registered, these custom resources can be created, read, updated, and deleted using standard Kubernetes tools like kubectl, just like native resources such as Pods or Deployments. This transforms Kubernetes from a generic container orchestrator into a domain-specific platform for managing any declarative state.
- Example: Defining a
InferenceServiceCRD to represent an LLM endpoint. - Result: Users can run
kubectl get inferenceservicesto list all deployed models.
Declarative State Specification
A custom resource is a declarative YAML/JSON manifest that describes the desired state of a custom object. The spec field contains the user's configuration, while the status field is managed by a controller to reflect the actual state. This pattern enforces a clean separation between user intent and system reality.
- Structure:
apiVersion,kind,metadata,spec,status. - Example: An
InferenceServicespec might define the model ID, compute resources, and autoscaling rules.
Controller Reconciliation Loop
A custom resource is inert without a controller (often implemented as an Operator). The controller runs a continuous reconciliation loop, watching for changes to custom resources. It compares the spec (desired state) with the status (observed state) and executes imperative logic—like deploying Pods or configuring services—to drive the cluster toward the desired state. This is the core automation mechanism for CRDs.
- Watch: The controller subscribes to API events for the custom resource.
- Diff & Act: It computes the difference between spec and status and takes corrective actions.
- Update Status: It writes the current observed state back to the resource's
statusfield.
Schema Validation with OpenAPI
CRDs can include a structured validation schema using OpenAPI v3, which is enforced by the Kubernetes API server upon creation or update. This prevents invalid configurations from being stored. The schema defines required fields, data types, and value constraints for the spec.
- Benefit: Catches configuration errors immediately at the API layer.
- Example: Validating that a
replicaCountfield is an integer greater than zero. - Tooling: Schemas enable better IDE support and documentation generation.
Integration with Core Kubernetes Primitives
Custom resources integrate seamlessly with native Kubernetes ecosystems. They can be referenced by other resources, managed by tools like Helm, secured via RBAC, and monitored through standard APIs. This allows custom abstractions to leverage the full power of the platform.
- RBAC: Define roles that grant permissions to
createorwatchcustom resources. - Helm: Package and deploy a CRD and its controller as a single chart.
- Service Mesh: A custom
SmartRouterresource could generate Istio VirtualService configuration.
Foundation for Operators
CRDs are the essential data model for the Operator Pattern, a method of packaging and deploying complex, stateful applications on Kubernetes. An Operator consists of one or more CRDs (to define the application's domain) and a controller (to manage its lifecycle). This pattern is critical for LLMOps, enabling the declarative management of resources like InferenceService, LLMFineTuneJob, or PromptVersion.
- Use Case: An LLM Serving Operator uses an
InferenceServiceCRD to manage model deployments, autoscaling, and canary rollouts. - Automation: The operator handles complex operational tasks like GPU provisioning and model caching, reducing manual toil.
CRD vs. Other Kubernetes Extension Mechanisms
A feature comparison of Custom Resource Definitions (CRDs) against other primary methods for extending the Kubernetes API, highlighting their respective use cases in LLM deployment and serving.
| Feature / Mechanism | Custom Resource Definition (CRD) | Aggregated API Server | Custom API Server | ||||
|---|---|---|---|---|---|---|---|
Primary Purpose | Define new resource types (Kinds) within the existing API server | Proxy API requests to a separate, dedicated server | Deploy a standalone API server with full control | ||||
API Path & Group | Managed under the main API server (e.g., apiextensions.k8s.io) | Registered under the main API server's aggregation layer | Operates on its own, distinct API path and group | ||||
Implementation Complexity | Low to Medium. Define a schema; controller logic is separate. | High. Requires building and operating a full API server. | Highest. Requires building and operating a full, standalone API server. | ||||
Operational Overhead | Low. Managed by the Kubernetes API server; no additional servers. | Medium. Requires deploying and managing the aggregated server. | High. Full lifecycle management of a separate API server. | ||||
Storage & Persistence | Uses etcd via the main API server. Schema-defined. | Managed by the aggregated server (can use its own storage). | Managed entirely by the custom server (full control over storage). | Validation & DefaultingDeclarative schema validation (OpenAPI v3). Mutating admission via webhooks.Implemented within the aggregated server's business logic.Fully implemented within the custom server's business logic. | Versioning & ConversionSupported via multiple versions in the CRD definition with conversion webhooks.Handled internally by the aggregated server's API logic.Handled internally by the custom server's API logic. | Common Use Case in LLM OpsDefining custom resources like 'InferenceService' or 'LLMDeployment' for an Operator.Extending the API for a complex, self-contained service (less common for pure resources).Rare. Typically for services needing complete API isolation or pre-dating CRDs. | Recommended ForExtending Kubernetes with new declarative resource types for controllers/operators.Integrating existing external services with a Kubernetes-native API facade.Legacy integration or scenarios requiring absolute control, bypassing kube-apiserver features. |
Frequently Asked Questions
A Custom Resource Definition (CRD) is a fundamental Kubernetes extension mechanism. These FAQs address its role in deploying and managing AI/ML workloads, particularly for LLM serving.
A Custom Resource Definition (CRD) is a Kubernetes API extension that allows users to define and manage their own custom object types, called Custom Resources (CRs), within a Kubernetes cluster. It effectively teaches the Kubernetes API server about a new kind of object, such as an InferenceService or LLMDeployment, which can then be created, updated, and deleted using standard kubectl commands, just like native resources like Pods or Deployments. CRDs are the foundational building block for creating Kubernetes Operators, which provide the automation logic to reconcile the state of these custom objects. For example, defining a ModelServing CRD lets platform engineers declare a desired model state (e.g., model ID, replicas, GPU type), and a corresponding Operator can then orchestrate the underlying Pods, Services, and configurations to realize that state.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Custom Resource Definitions (CRDs) are a core Kubernetes extension mechanism. These related concepts define the ecosystem for deploying and managing complex applications, like LLM inference services, in a declarative, automated way.
Controller
A Controller is a core Kubernetes concept and the active component of an Operator. It is a control loop that:
- Watches the state of specified resources (both built-in like Pods, and custom ones defined by CRDs).
- Compares the observed state with the desired state specified in the resource's spec.
- Makes Changes via the Kubernetes API to drive the observed state toward the desired state. This process is called reconciliation.
For a CRD like InferenceService, the custom controller is responsible for interpreting its spec and creating the necessary Deployments, Services, and ConfigMaps to realize a running inference endpoint.
Custom Resource (CR)
A Custom Resource (CR) is an instance of a Custom Resource Definition (CRD). While the CRD defines the schema (the type of object, like InferenceService), the CR is a concrete instance of that type with specific values.
- Example: If a CRD defines an
InferenceServicewith fields formodelNameandreplicas, a CR would be a YAML file declaringmodelName: mixtral-8x7bandreplicas: 2. - Declarative API: The CR's spec field contains the user's desired state. The associated controller reads this spec and acts to make it true.
- Storage: CRs are persistent objects stored in the Kubernetes API server's backing store (etcd), just like native resources such as Pods or Deployments.
Horizontal Pod Autoscaler (HPA)
The Horizontal Pod Autoscaler (HPA) is a built-in Kubernetes controller that automatically scales the number of Pod replicas in a Deployment or StatefulSet based on observed metrics like CPU utilization or custom metrics.
- Integration with CRDs: A custom controller for an
InferenceServiceCRD would typically create a standard Kubernetes Deployment. It could then also create an HPA resource targeting that Deployment to enable automatic scaling based on inference request load (e.g., queries per second). - Declarative Scaling: This allows the LLM serving infrastructure to be defined declaratively: the CR specifies the initial replica count, and the HPA policy defines how it should scale under load, all managed by Kubernetes.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us