Chapter 16. CustomResourceDefinitions (CRDs)

Kubernetes provides primitives that support the most common use cases required by operators of an application stack. For custom use cases, Kubernetes allows for implementing and installing extensions to the platform.

A CustomResourceDefinition (CRD) is a Kubernetes extension mechanism for introducing custom API primitives to fulfill requirements not covered by built-in primitives. This chapter will primarily focus on the implementation of and interaction with CRDs.

Working with CRDs

CRDs can be understood as the schema that defines the blueprint for a custom object, and then the instantiation of those objects with the newly introduced type. For a CRD to be useful, it has to be backed by a controller. Controllers interact with the Kubernetes API and implement the reconciliation logic that interacts with CRD objects. The combination of CRDs and controllers is commonly referred to as the operator pattern. The exam does not require you to have an understanding of controllers; therefore, their implementation won’t be covered in this chapter. Figure 16-1 shows the operator patterns with all its moving parts.

ckd2 1601
Figure 16-1. The Kubernetes operator pattern

The Kubernetes community has implemented ...

Get Certified Kubernetes Application Developer (CKAD) Study Guide, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.