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 in Kubernetes?
A Custom Resource is a way to extend Kubernetes by adding your own API objects. It lets you define new types of resources beyond the built-in ones like Pods or Services.
Click to reveal answer
beginner
What is a CustomResourceDefinition (CRD)?
A CRD is a Kubernetes object that defines a new Custom Resource type. It tells Kubernetes how to recognize and handle your custom objects.
Click to reveal answer
beginner
How do Custom Resources help in Kubernetes?
They let you add new resource types to manage your own applications or infrastructure in Kubernetes, making it more flexible and powerful.
Click to reveal answer
beginner
What command creates a CustomResourceDefinition from a YAML file?
kubectl apply -f your-crd-file.yaml
Click to reveal answer
intermediate
Can you use Custom Resources without writing any code?
Yes, you can create and manage Custom Resources using YAML files and kubectl commands without writing code, but to add logic you might write controllers.
Click to reveal answer
What does a CustomResourceDefinition (CRD) do in Kubernetes?
AMonitors cluster health
BDeletes existing Kubernetes resources
CManages user access
DDefines a new resource type for Kubernetes
✗ Incorrect
A CRD defines a new resource type so Kubernetes can understand and manage custom objects.
Which command applies a CustomResourceDefinition YAML file?
Akubectl delete crd
Bkubectl get crd
Ckubectl apply -f file.yaml
Dkubectl describe crd
✗ Incorrect
kubectl apply -f file.yaml creates or updates resources defined in the YAML file.
What is a main benefit of using Custom Resources?
AImproving network speed
BExtending Kubernetes with new resource types
CReducing storage usage
DAutomatically scaling nodes
✗ Incorrect
Custom Resources let you add new resource types to Kubernetes for managing custom needs.
Can you manage Custom Resources without writing code?
AYes, using YAML and kubectl
BOnly through the Kubernetes dashboard
COnly with special plugins
DNo, code is always required
✗ Incorrect
You can create and manage Custom Resources using YAML files and kubectl commands.
What Kubernetes object lets you add logic to Custom Resources?
AController
BPod
CService
DNamespace
✗ Incorrect
Controllers watch Custom Resources and add behavior or automation.
Explain what Custom Resources and CustomResourceDefinitions are in Kubernetes and why they are useful.
Think about how Kubernetes can be made to understand new types of objects.
You got /4 concepts.
Describe the steps to create and use a Custom Resource in a Kubernetes cluster.
Focus on the YAML files and kubectl commands involved.
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of a Custom Resource in Kubernetes?
easy
A. To delete all existing Kubernetes resources
B. To replace built-in Kubernetes objects like Pods
C. To automatically update Kubernetes itself
D. To add new object types to Kubernetes for custom app needs
Solution
Step 1: Understand Kubernetes object types
Kubernetes has built-in objects like Pods and Services, but sometimes you need new types for your apps.
Step 2: Role of Custom Resources
Custom Resources let you define new object types to extend Kubernetes capabilities without changing its core.
Final Answer:
To add new object types to Kubernetes for custom app needs -> Option D
Quick Check:
Custom Resources extend Kubernetes = A [OK]
Hint: Custom Resources add new types, not replace or delete [OK]
A. It controls the storage backend for the resource
B. It defines the kind name used when creating custom resource objects
C. It sets the namespace where the resource lives
D. It specifies the API version of the custom resource
Solution
Step 1: Understand spec.names.kind role
This field sets the kind name you use in YAML when creating instances of this custom resource.
Step 2: Differentiate from other fields
API version is under versions.name, scope is separate, storage backend is not set here.
Final Answer:
It defines the kind name used when creating custom resource objects -> Option B
Quick Check:
spec.names.kind = kind name for objects [OK]
Hint: spec.names.kind is the object kind name in YAML [OK]
Common Mistakes:
Confusing kind with API version
Thinking it sets namespace or storage
Mixing plural and kind meanings
4. You applied a CustomResourceDefinition YAML but get an error: error: unable to recognize "crd.yaml": no matches for kind "CustomResourceDefinition" in version "v1beta1". What is the likely cause?
medium
A. Missing metadata.name field in the YAML
B. Trying to create a Pod instead of a CustomResourceDefinition
C. Using deprecated API version v1beta1 instead of apiextensions.k8s.io/v1
D. Incorrect indentation in the YAML file
Solution
Step 1: Analyze the error message
The error says no matches for kind "CustomResourceDefinition" in version "v1beta1" which means the API version is not supported.
Step 2: Check Kubernetes API version support
Since Kubernetes 1.22+, the v1beta1 version for CustomResourceDefinition is removed; use apiextensions.k8s.io/v1 instead.
Final Answer:
Using deprecated API version v1beta1 instead of apiextensions.k8s.io/v1 -> Option C
Quick Check:
Deprecated API version causes no match error [OK]
Hint: Use apiextensions.k8s.io/v1 for CRD, not v1beta1 [OK]
Common Mistakes:
Ignoring API version deprecation
Assuming missing metadata causes this error
Blaming YAML indentation without checking version
5. You want to create a custom resource named Gadget with group devices.example.com and version v1. Which is the correct minimal spec section of the CustomResourceDefinition YAML?