CertLumen

Certified Kubernetes Application Developer (CKAD) · Section 4 · 25% of the exam

Discover and use resources that extend Kubernetes (CRD, Operators)

One of the objectives of the Certified Kubernetes Application Developer (CKAD) exam, in the section “Application Environment, Configuration and Security”. Here is what it covers, the points to remember and a question to try.

What it covers

A CustomResourceDefinition teaches the API server a new resource type, and a controller turns objects of that type into real work. This lesson covers how to find, read and use CRDs and custom resources with kubectl, how schemas and versions behave, and what an Operator adds on top.

Points to remember

  • A CRD (apiextensions.k8s.io/v1) adds a new resource type to the API; an object of that type is a custom resource.
  • A CRD's metadata.name must be <plural>.<group>; scope is Namespaced or Cluster; exactly one version has storage: true.
  • Unknown fields not in the structural schema are pruned unless x-kubernetes-preserve-unknown-fields is true.
  • Deleting a CRD deletes all of its custom resources.
  • Use kubectl get crd, kubectl api-resources and kubectl explain <kind>.spec to discover and read custom resources.

Try a question

A controller ServiceAccount logs backups.db.example.com is forbidden: User "system:serviceaccount:ops:db-operator" cannot list resource "backups" in API group "db.example.com" at the cluster scope. Which ClusterRole rule fixes this with the least privilege?

  1. AapiGroups "", resources backups, verbs get, list, watch
  2. BapiGroups db.example.com, resources backups, verbs get, list, watch
  3. CapiGroups apiextensions.k8s.io, resources customresourcedefinitions, verbs list
  4. DapiGroups *, resources *, verbs *
Show the answer

B. The 403 message tells you exactly what to grant: the verb, the resource, the API group and the scope. Because the error says cluster scope, a ClusterRole with a ClusterRoleBinding is needed (or a Role per namespace if the operator is namespaced).

Written for practice in the style of the exam: never a question from the real exam.

In the course

The lesson Custom Resources, CRDs and Operators teaches this objective (about 40 minutes), and 10 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.

More in this section

← Previous objective · All 24 objectives · Next objective →