From f65ca19b44e6012437275da530f64feee85bd8c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Petazzoni?= Date: Mon, 6 Jun 2022 13:59:13 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=83=20Mention=20type=20validation=20is?= =?UTF-8?q?sues=20for=20CRDs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- slides/k8s/crd.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/slides/k8s/crd.md b/slides/k8s/crd.md index 410d5d35..0df555c9 100644 --- a/slides/k8s/crd.md +++ b/slides/k8s/crd.md @@ -105,7 +105,7 @@ spec: .lab[ -- Create a few types of coffee beans: +- Try to create a few types of coffee beans: ```bash kubectl apply -f ~/container.training/k8s/coffees.yaml ``` @@ -114,6 +114,20 @@ spec: --- +## Type validation + +- Older versions of Kubernetes will accept our coffee beans as is + +- Newer versions, however, will issue warnings about unknown fields + + (and if we turn off validation, these fields will simply be dropped) + +- We need to improve our OpenAPI schema + + (to add e.g. the `spec.taste` field used by our coffee resources) + +--- + ## Viewing custom resources - By default, `kubectl get` only shows name and age of custom resources