Which mechanism allows extending the Kubernetes API?
A
ConfigMap
B
CustomResourceDefinition
Correta
C
MutatingAdmissionWebhookmechamsm
D
Kustomize
Explicação Oficial / Explicações da Comunidade
The Kubernetes API can be extended using CustomResourceDefinitions (CRDs). CRDs allow users to define custom resources that behave like native Kubernetes resources, enabling the API server to serve and store them. This mechanism is the primary way to extend the Kubernetes API without modifying the core code.
How it Works:
A CustomResourceDefinition defines a new resource type by specifying its name, group, version, and schema. Once created, the Kubernetes API server automatically generates RESTful endpoints for that resource, and users can create, read, update, and delete custom objects via kubectl or API calls. CRDs are fully integrated with RBAC, admission controllers, and other Kubernetes features.
Why the Correct Value is Right:
CustomResourceDefinition is the standard, built-in mechanism for extending the Kubernetes API. It is widely used for operators and custom controllers.
Why the Incorrect Values are Wrong:
ConfigMap is used to store configuration data as key-value pairs, not to extend the API.
MutatingAdmissionWebhook is an admission controller that intercepts API requests to mutate them, but it does not define new resource types.
Kustomize is a configuration management tool for customizing Kubernetes manifests, not an API extension mechanism.