Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What is a Custom Resource Definition (CRD) in Kubernetes?
A CRD is a way to add your own custom objects to Kubernetes. It lets you define new resource types beyond the built-in ones, so you can manage your own data with Kubernetes tools.
Click to reveal answer
beginner
How do you create a new custom resource type in Kubernetes?
You create a CRD YAML file that defines the new resource's name, version, and schema, then apply it with kubectl. This tells Kubernetes about your new resource type.
Click to reveal answer
beginner
What command applies a CRD YAML file to the Kubernetes cluster?
kubectl apply -f applies the CRD to the cluster, registering the new custom resource type.
Click to reveal answer
intermediate
Why use CRDs instead of ConfigMaps or Secrets for custom data?
CRDs let you create structured, typed resources with validation and versioning. ConfigMaps and Secrets are simpler key-value stores without schema or lifecycle management.
Click to reveal answer
intermediate
What is the role of a controller with CRDs?
A controller watches custom resources and acts on changes. It helps automate tasks like creating pods or updating status based on the custom resource's state.
Click to reveal answer
What does a Custom Resource Definition (CRD) allow you to do in Kubernetes?
AUpgrade Kubernetes versions
BDefine new resource types
CDelete nodes automatically
DMonitor cluster health
✗ Incorrect
CRDs let you define new resource types that Kubernetes can manage.
Which command is used to apply a CRD YAML file to a Kubernetes cluster?
Akubectl apply -f <file>
Bkubectl create crd
Ckubectl get crd
Dkubectl delete crd
✗ Incorrect
kubectl apply -f applies the CRD YAML to the cluster.
What is a key benefit of using CRDs over ConfigMaps for custom data?
ACRDs support schema validation
BConfigMaps are encrypted by default
CCRDs cannot be versioned
DConfigMaps allow custom resource types
✗ Incorrect
CRDs support schema validation, making data structured and reliable.
What component typically watches CRDs to automate actions?
AScheduler
BAPI Server
CController
DKubelet
✗ Incorrect
Controllers watch CRDs and automate responses to changes.
Which of these is NOT true about CRDs?
AThey extend Kubernetes with new resource types
BThey support versioning and validation
CThey can be managed with kubectl
DThey require writing Go code to use
✗ Incorrect
You do not need to write Go code to use CRDs; you define them with YAML.
Explain what a Custom Resource Definition (CRD) is and why it is useful in Kubernetes.
Think about how Kubernetes can manage things beyond built-in resources.
You got /4 concepts.
Describe the steps to create and use a new custom resource in Kubernetes using a CRD.
Focus on YAML definition, applying it, and using the new resource.
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of a Custom Resource Definition (CRD) in Kubernetes?
easy
A. To add new resource types to Kubernetes that are not built-in
B. To update the Kubernetes version automatically
C. To manage user permissions in Kubernetes
D. To monitor cluster health and performance
Solution
Step 1: Understand what CRDs do
CRDs allow users to create their own resource types beyond the default Kubernetes resources.
Step 2: Compare options
Automatic version updates, user permissions (RBAC), and cluster monitoring are separate Kubernetes features unrelated to CRDs.
Final Answer:
To add new resource types to Kubernetes that are not built-in -> Option A
Quick Check:
CRDs = add custom resource types [OK]
Hint: CRDs = add your own resource types [OK]
Common Mistakes:
Confusing CRDs with RBAC for permissions
Thinking CRDs update Kubernetes versions
Assuming CRDs monitor cluster health
2. Which of the following is the correct YAML key to define the API version for a CRD?
easy
A. version
B. api_version
C. apiVersion
D. apiVer
Solution
Step 1: Recall Kubernetes YAML syntax
Kubernetes uses camelCase keys like apiVersion to specify API versions.
Step 2: Check other options
version, api_version, and apiVer use incorrect formats not recognized by Kubernetes.
Final Answer:
apiVersion -> Option C
Quick Check:
Correct YAML key = apiVersion [OK]
Hint: Use camelCase keys like apiVersion in Kubernetes YAML [OK]
Common Mistakes:
Using underscores instead of camelCase
Using incomplete or shortened keys
Confusing version with apiVersion
3. Given this CRD snippet, what is the scope of the custom resource?
Hint: scope: Namespaced means resource lives inside namespaces [OK]
Common Mistakes:
Confusing Namespaced with Cluster scope
Assuming default namespace only
Thinking scope relates to nodes
4. You applied a CRD YAML but get an error: "unknown field 'kindd'". What is the most likely cause?
medium
A. Typo in the YAML key 'kindd' instead of 'kind'
B. Missing apiVersion field
C. CRD name is not unique
D. Cluster role permissions missing
Solution
Step 1: Analyze the error message
The error says "unknown field 'kindd'", indicating a typo in the YAML key.
Step 2: Identify the correct key
The correct key is kind, so kindd is a misspelling causing the error.
Final Answer:
Typo in the YAML key 'kindd' instead of 'kind' -> Option A
Quick Check:
YAML key typos cause unknown field errors [OK]
Hint: Check YAML keys carefully for typos [OK]
Common Mistakes:
Ignoring spelling errors in YAML keys
Assuming missing fields cause unknown field errors
Blaming permissions for syntax errors
5. You want to create a CRD for a resource named Gadget that is cluster-scoped and has a plural name gadgets. Which YAML snippet correctly defines this?
The resource must be cluster-scoped, so scope: Cluster is correct.
Step 2: Verify kind and plural names
kind should be capitalized as Gadget and plural should be gadgets (plural lowercase).
Step 3: Compare options
The snippet with scope: Cluster, kind: Gadget, plural: gadgets matches all requirements. Snippets with scope: Namespaced, lowercase kind: gadget, or singular plural: gadget are incorrect.