What are native and custom resource in Kubernetes

 In Kubernetes, resources are objects that represent different entities within the cluster. These resources can be native (built-in) or custom (user-defined).

1️⃣ Native Resources

🔹 Definition: Native resources are built-in Kubernetes objects that come pre-defined in the Kubernetes API.
🔹 Examples:

  • Pods (Pod)
  • Services (Service)
  • Deployments (Deployment)
  • ConfigMaps (ConfigMap)
  • Secrets (Secret)
  • Ingress (Ingress)
  • PersistentVolumes (Persistent Volume)

2️⃣ Custom Resources (CRs)

🔹 Definition: Custom resources extend Kubernetes by adding new API objects beyond the built-in ones.
🔹 Requires:
✔ CRD (Custom Resource Definition) – Defines the schema of the new resource.
✔ CR (Custom Resource) – An instance of the custom resource.
✔ Custom Controller (optional) – Manages custom resources.

✅ Why use Custom Resources?

  • Allows Kubernetes to support new types of workloads.
  • Useful for domain-specific applications (e.g., Operators, CRDs for databases, monitoring tools).
  • Extends Kubernetes without modifying its core API.


When to Use Native vs. Custom Resources?

✔ Use Native Resources if your needs are covered by Kubernetes (e.g., managing workloads, networking, storage).
✔ Use Custom Resources when you need to extend Kubernetes for specialized workloads (e.g., CRDs for databases, machine learning models, or infrastructure management).