CRD Versioning and Conversion Webhooks
Expert · 60 minutes · 5 tasks, checked automatically · 100 points
In this expert-level lab you will build a complete CRD versioning and conversion webhook pipeline from scratch. You will define a CustomResourceDefinition with two API versions (v1alpha1 and v1beta1), deploy a conversion webhook server that translates objects between those versions, wire up the webhook in the CRD spec, and finally verify that objects written in one version are transparently served in the other. This pattern is the foundation of every production-grade Kubernetes operator that needs to evolve its API without breaking existing clients.
What you’ll learn
- Define a multi-version CRD with v1alpha1 and v1beta1 schemas and mark v1beta1 as the storage version
- Deploy a TLS-enabled conversion webhook server and create the required Secret, Service, and Deployment
- Configure the CRD conversion strategy to use the webhook and verify cross-version object translation
How this lab works
- Start the lab: One click starts a real Kubernetes cluster on your computer (kind), with kubectl ready in a toolbox terminal.
- Work through 5 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
- Check your work: Check my work reads your live cluster and says, task by task, what passed and what to fix.
- Finish and keep going: 100 points, your progress saved, and the next lab to try.
What it runs on
- Cluster: A real Kubernetes cluster on your computer (kind)
- Kubernetes: 1.34.8
What you need
- A free LearnXops account
- The LearnXops desktop app for macOS, Windows or Linux
- Docker Desktop installed and running
- A kind cluster created in the Kubernetes Playground
Topics: crd, conversion-webhook, versioning, operators, apiextensions, tls
Create a free account to start this lab.
Keep going
- Scaffold an Operator with the Operator SDK
- Build a Controller with the client-go Informer Pattern
- Implement a Reconcile Loop with Owner References
- Run Virtual Machines on Kubernetes with KubeVirt
- Platform Engineering with Crossplane
- Build a Custom Resource and Reconcile It with an Operator (kubebuilder/CRD basics)