Difficulty: Beginner
Estimated Time: 15 minutes

Kubernetes Custom Resource Definitions


This scenario takes you through the essentials of defining new Kubernetes Custom Resource Definitions (CRDs). You will extend Kubernetes by creating new resources beyond the standard ones you normally get with any Kubernetes cluster. Once you understand CRDs this will lead you to understanding how to further extend Kubernetes using the powerful Operator Pattern.

In this scenario you will learn how to:

  • Create a CRD and define custom attributes
  • Discover how your CRD becomes a new resource
  • Add, inspect and remove instances of a custom resource


Custom Resource Definitions (CRDs) are a mechanism used to add new kinds into a Kubernetes cluster. CRDs are all part of the extensibility of Kubernetes and it API. CRDs are in widespread use as a Kubernetes extensibility mechanism and have been available in beta since the 1.7 release. The 1.16 release marks the graduation of CRDs to general availability (GA). When added with controllers watching the CRDs, enables a custom declarative experience. You now have a solid introduction to the powerful Operator Pattern.

Lessons Learned

With these steps you have learned:

  • ✔ how to create a CRD and define custom attributes,
  • ✔ how how your CRD becomes a new resource,
  • ✔ how to add, inspect and remove instances of a custom resource.

Special Thank You

To Ken Sipe as he inspired this scenario from his labs found here.


For a deeper understanding of these topics and more join
Jonathan Johnson
at various conferences, symposiums, workshops, and meetups.

Software Architectures ★ Speaker ★ Workshop Hosting ★ Kubernetes & Java Specialist

Custom Resource Definitions

Step 1 of 6

Your Kubernetes Cluster

For this scenario, Katacoda has just started a fresh Kubernetes cluster for you. Verify it's ready for your use.

kubectl version --short && \ kubectl get componentstatus && \ kubectl get nodes && \ kubectl cluster-info

The Helm package manager used for installing applications on Kubernetes is also available.

helm version --short

Kubernetes Dashboard

You can administer your cluster with the kubectl CLI tool or use the visual Kubernetes Dashboard. Use this script to access the protected Dashboard.


This tab will not be visible to users and provides only information to help authors when creating content.

Creating Katacoda Scenarios

Thanks for creating Katacoda scenarios. This tab is designed to help you as an author have quick access the information you need when creating scenarios.

Here are some useful links to get you started.

Running Katacoda Workshops

If you are planning to use Katacoda for workshops, please contact [email protected] to arrange capacity.

Debugging Scenarios

Below is the response from any background scripts run or files uploaded. This stream can aid debugging scenarios.

If you still need assistance, please contact [email protected]