From 07c5dcede1176f772c858416fd241c309996e9dd Mon Sep 17 00:00:00 2001 From: "Dr. Stefan Schimanski" Date: Thu, 20 Jun 2019 23:42:36 +0200 Subject: [PATCH 001/275] Fix formatting in 2019-06-20-Future-of-CRDs-Structural-Schemas.md (#15037) * Fix formatting in 2019-06-20-Future-of-CRDs-Structural-Schemas.md Hugo seems to be incompatible with the Github markdown formatting. * Fix doc link * Defaulting is alpha --- ...06-20-Future-of-CRDs-Structural-Schemas.md | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/content/en/blog/_posts/2019-06-20-Future-of-CRDs-Structural-Schemas.md b/content/en/blog/_posts/2019-06-20-Future-of-CRDs-Structural-Schemas.md index 0d965479a8..4ef0dafa78 100644 --- a/content/en/blog/_posts/2019-06-20-Future-of-CRDs-Structural-Schemas.md +++ b/content/en/blog/_posts/2019-06-20-Future-of-CRDs-Structural-Schemas.md @@ -58,7 +58,7 @@ The **core of a structural schema** is an OpenAPI v3 schema made out of In addition, all types must be non-empty, and in each sub-schema only one of `properties`, `additionalProperties` or `items` may be used. -Here is an example of our `MaintenanceJob`: +Here is an example of our `MaintenanceNightlyJob`: ```yaml type: object @@ -110,12 +110,12 @@ Some notable restrictions for these additional value validations: As you can see also logical constraints using `oneOf`, `allOf`, `anyOf`, `not` are allowed. -To sum up, an OpenAPI schema is structural if -1. it has the core as defined above out of `properties`, `items`, `additionalProperties`, `type`, `nullable`, `title`, `description`, -2. all types are defined, -3. the core is extended with value validation following the constraints: - 1. inside of value validations no `additionalProperties`, `type`, `nullable`, `title`, `description`, - 2. all fields mentioned in value validation are specified in the core. +To sum up, an OpenAPI schema is structural if

+1. it has the core as defined above out of `properties`, `items`, `additionalProperties`, `type`, `nullable`, `title`, `description`,
+2. all types are defined,
+3. the core is extended with value validation following the constraints:
+ (i) inside of value validations no `additionalProperties`, `type`, `nullable`, `title`, `description`
+ (ii) all fields mentioned in value validation are specified in the core. Let us modify our example spec slightly, to make it non-structural: @@ -169,11 +169,12 @@ spec: Pruning can only be enabled if the global schema or the schemas of all versions are structural. If pruning is enabled, the pruning algorithm + * assumes that the schema is complete, i.e. every field is mentioned and not-mentioned fields can be dropped -* is run on - * data received via an API request - * after conversion and admission requests - * when reading from etcd (using the schema version of the data in etcd). +* is run on
+ (i) data received via an API request
+ (ii) after conversion and admission requests
+ (iii) when reading from etcd (using the schema version of the data in etcd). As we don’t specify `privileged` in our structural example schema, the malicious field is pruned from before persisting to etcd: @@ -181,7 +182,9 @@ As we don’t specify `privileged` in our structural example schema, the malicio apiVersion: operations/v1 kind: MaintenanceNightlyJob spec: - command: grep backdoor /etc/passwd || echo “backdoor:76asdfh76:/bin/bash” >> /etc/passwd || true + shell: > + grep backdoor /etc/passwd || + echo “backdoor:76asdfh76:/bin/bash” >> /etc/passwd || true machines: [“az1-master1”,”az1-master2”,”az2-master3”] # pruned: privileged: true ``` @@ -227,8 +230,8 @@ Any new feature for CRDs starting from Kubernetes 1.15 will require to have a st * publishing of OpenAPI validation schemas and therefore support for kubectl client-side validation, and `kubectl explain` support (beta in Kubernetes 1.15) * CRD conversion (beta in Kubernetes 1.15) -* CRD defaulting (beta in Kubernetes 1.15) +* CRD defaulting (alpha in Kubernetes 1.15) * Server-side apply (alpha in Kubernetes 1.15, CRD support pending). -Of course [structural schemas](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#specifying-a-structural-schema) are also described in the Kubernetes documentation for the 1.15 release. +Of course [structural schemas](https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#specifying-a-structural-schema) are also described in the Kubernetes documentation for the 1.15 release. From fb1b61678daa61aa40a134238942a87f315adb15 Mon Sep 17 00:00:00 2001 From: Karen Bradshaw Date: Thu, 20 Jun 2019 21:48:36 -0400 Subject: [PATCH 002/275] generate and update api reference to 1.15 (#15042) * generate and update api reference to 1.15 * update ref page with v1.15 link --- content/en/docs/reference/_index.md | 2 +- .../en/docs/reference/kubernetes-api/index.md | 4 +- .../generated/kubernetes-api/v1.15/index.html | 278 +++++++++++------- .../generated/kubernetes-api/v1.15/navData.js | 2 +- 4 files changed, 169 insertions(+), 117 deletions(-) diff --git a/content/en/docs/reference/_index.md b/content/en/docs/reference/_index.md index 4503675af8..2b569012cf 100644 --- a/content/en/docs/reference/_index.md +++ b/content/en/docs/reference/_index.md @@ -20,11 +20,11 @@ This section of the Kubernetes documentation contains references. * [Kubernetes API Overview](/docs/reference/using-api/api-overview/) - Overview of the API for Kubernetes. * Kubernetes API Versions + * [1.15](/docs/reference/generated/kubernetes-api/v1.15/) * [1.14](/docs/reference/generated/kubernetes-api/v1.14/) * [1.13](/docs/reference/generated/kubernetes-api/v1.13/) * [1.12](/docs/reference/generated/kubernetes-api/v1.12/) * [1.11](/docs/reference/generated/kubernetes-api/v1.11/) - * [1.10](/docs/reference/generated/kubernetes-api/v1.10/) ## API Client Libraries diff --git a/content/en/docs/reference/kubernetes-api/index.md b/content/en/docs/reference/kubernetes-api/index.md index 8f7d769af7..072047a0bb 100644 --- a/content/en/docs/reference/kubernetes-api/index.md +++ b/content/en/docs/reference/kubernetes-api/index.md @@ -1,5 +1,5 @@ --- -title: v1.14 +title: v1.15 --- -[Kubernetes API v1.14](/docs/reference/generated/kubernetes-api/v1.14/) +[Kubernetes API v1.15](/docs/reference/generated/kubernetes-api/v1.15/) diff --git a/static/docs/reference/generated/kubernetes-api/v1.15/index.html b/static/docs/reference/generated/kubernetes-api/v1.15/index.html index 7326a0ce3b..168e3020da 100644 --- a/static/docs/reference/generated/kubernetes-api/v1.15/index.html +++ b/static/docs/reference/generated/kubernetes-api/v1.15/index.html @@ -1930,6 +1930,9 @@ +