Day 49 - Custom Resource Definition (CRD, CR) Kubernetes (explained with Demo)

About this video

### Comprehensive Final Summary The document provides a detailed exploration of **Custom Resources (CR)** and **Custom Resource Definitions (CRDs)** in Kubernetes, presented by Pyush in an unedited, step-by-step video format. The content is structured to build understanding from foundational concepts to practical implementation, with insights into exam preparation and real-world use cases like the Certificate Manager. #### **Key Concepts** 1. **Introduction to Custom Resources and CRDs**: - The video emphasizes learning CRs and CRDs from scratch, offering a transparent, uninterrupted teaching approach. - Kubernetes' default resources (e.g., pods, deployments, config maps) are extended using custom resources to address specific use cases not covered by the platform out-of-the-box. 2. **Why Extend the Kubernetes API?**: - Extending the Kubernetes API allows users to implement custom logic, GitOps workflows, or monitoring solutions without relying on external tools. - This flexibility enables organizations to tailor Kubernetes to their unique operational needs by defining new resource types. 3. **How Custom Resources Work**: - A **Custom Resource Definition (CRD)** serves as a template that defines the structure, validation rules, supported versions, and data types for custom resources. - A **Custom Resource (CR)** is an instance of the CRD, created using YAML or JSON manifests, and validated against the CRD's specifications. 4. **Key Components**: - **CRD**: Acts as the blueprint for custom resources, ensuring consistency and validation. - **CR**: Represents an actual object instantiated from the CRD. - **Custom Controller**: An optional but recommended component that manages the lifecycle of custom resources, ensuring they maintain their desired state. 5. **Lifecycle of Custom Resources**: - The process begins with a DevOps engineer creating the CRD. - Developers or operators then create custom resources based on the CRD. - If a custom controller is implemented, it ensures the custom resource behaves as intended by reconciling its state. #### **Practical Demonstration** - The video includes a hands-on demo where a sample repository containing a CRD is cloned and applied using `kubectl`. - It demonstrates creating a custom resource based on the CRD, highlighting validation errors when fields don't align with the CRD's definition. - The instructor uses `kubectl` commands to describe and inspect custom resources and their fields, showcasing how to troubleshoot and verify configurations. #### **Exam Preparation Tips** - The document outlines potential exam tasks, such as: - Creating and managing CRDs and custom resources. - Describing CRDs and custom resources using `kubectl`. - Extracting field documentation using `kubectl explain`, which is crucial for understanding and configuring custom resources effectively. #### **Real-World Application: Certificate Manager** - The video demonstrates installing and managing a **Certificate Manager** as a custom resource using Helm, focusing on CRDs. - Key steps include: - Adding the Certificate Manager repository via Helm. - Installing the chart with `CRDs.enable=true` to allow Helm to install CRDs (set to `false` if CRDs already exist). - Verifying installed CRDs using `kubectl` commands, such as filtering by "certificate." - Although no certificates are created in this example, the instructor explains how to explore fields like `spec.subject` in the Certificate CRD using `kubectl explain`. - This knowledge is vital for both exams and understanding Kubernetes operators. #### **Conclusion** - The video concludes by encouraging viewers to engage with the channel and mentions that deeper details about Cert Manager will be covered in future videos. - Overall, the document equips learners with a comprehensive understanding of CRs and CRDs, their lifecycle, practical implementation, and relevance in Kubernetes operations and certification exams. By combining theoretical explanations with practical demonstrations, the document ensures that viewers gain both conceptual clarity and hands-on skills, preparing them for real-world Kubernetes challenges and certification exams. **Final Takeaway**: Custom Resources and CRDs empower users to extend Kubernetes' functionality, enabling tailored solutions for diverse operational needs while maintaining seamless integration with the platform's ecosystem.


Course: Certified Kubernetes Administrator Full Course For beginners | CKA 2025

This playlist contains the complete CKA series for beginners, based on the latest 2025 curriculum. It includes 40+ videos with hands-on demos, assignments, and exam-based scenarios. We will cover everything from the basics to the Advanced, including fundamental concepts such as Docker, containers, Docker storage and networking, DNS, etc.

View Full Course