diff --git a/bootstrap/kubeadm/api/v1beta1/kubeadm_types.go b/bootstrap/kubeadm/api/v1beta1/kubeadm_types.go index 97b221af32cc..ec4406f9edd3 100644 --- a/bootstrap/kubeadm/api/v1beta1/kubeadm_types.go +++ b/bootstrap/kubeadm/api/v1beta1/kubeadm_types.go @@ -520,6 +520,9 @@ type Patches struct { // The default "patchtype" is "strategic". "extension" must be either "json" or "yaml". // "suffix" is an optional string that can be used to determine which patches are applied // first alpha-numerically. + // These files can be written into the target directory via KubeadmConfig.Files which + // specifies additional files to be created on the machine, either with content inline or + // by referencing a secret. // +optional Directory string `json:"directory,omitempty"` } diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml index 4cd75907ecb6..7d597f179e0e 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml @@ -2659,7 +2659,10 @@ spec: by kubectl. The default "patchtype" is "strategic". "extension" must be either "json" or "yaml". "suffix" is an optional string that can be used to determine which patches are applied - first alpha-numerically. + first alpha-numerically. These files can be written into + the target directory via KubeadmConfig.Files which specifies + additional files to be created on the machine, either with + content inline or by referencing a secret. type: string type: object type: object @@ -2859,7 +2862,10 @@ spec: by kubectl. The default "patchtype" is "strategic". "extension" must be either "json" or "yaml". "suffix" is an optional string that can be used to determine which patches are applied - first alpha-numerically. + first alpha-numerically. These files can be written into + the target directory via KubeadmConfig.Files which specifies + additional files to be created on the machine, either with + content inline or by referencing a secret. type: string type: object type: object diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml index 891d8320b990..731ade00ddaa 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml @@ -2691,6 +2691,10 @@ spec: "extension" must be either "json" or "yaml". "suffix" is an optional string that can be used to determine which patches are applied first alpha-numerically. + These files can be written into the target directory + via KubeadmConfig.Files which specifies additional + files to be created on the machine, either with + content inline or by referencing a secret. type: string type: object type: object @@ -2905,6 +2909,10 @@ spec: "extension" must be either "json" or "yaml". "suffix" is an optional string that can be used to determine which patches are applied first alpha-numerically. + These files can be written into the target directory + via KubeadmConfig.Files which specifies additional + files to be created on the machine, either with + content inline or by referencing a secret. type: string type: object type: object diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml index d8a624f5294a..8eedac711a0a 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml @@ -3128,6 +3128,10 @@ spec: is "strategic". "extension" must be either "json" or "yaml". "suffix" is an optional string that can be used to determine which patches are applied first alpha-numerically. + These files can be written into the target directory + via KubeadmConfig.Files which specifies additional files + to be created on the machine, either with content inline + or by referencing a secret. type: string type: object type: object @@ -3336,6 +3340,10 @@ spec: is "strategic". "extension" must be either "json" or "yaml". "suffix" is an optional string that can be used to determine which patches are applied first alpha-numerically. + These files can be written into the target directory + via KubeadmConfig.Files which specifies additional files + to be created on the machine, either with content inline + or by referencing a secret. type: string type: object type: object diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml index 4725d1dbb162..eba42e93d3ea 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml @@ -1928,7 +1928,11 @@ spec: is "strategic". "extension" must be either "json" or "yaml". "suffix" is an optional string that can be used to determine which patches are applied - first alpha-numerically. + first alpha-numerically. These files can be + written into the target directory via KubeadmConfig.Files + which specifies additional files to be created + on the machine, either with content inline or + by referencing a secret. type: string type: object type: object @@ -2152,7 +2156,11 @@ spec: is "strategic". "extension" must be either "json" or "yaml". "suffix" is an optional string that can be used to determine which patches are applied - first alpha-numerically. + first alpha-numerically. These files can be + written into the target directory via KubeadmConfig.Files + which specifies additional files to be created + on the machine, either with content inline or + by referencing a secret. type: string type: object type: object diff --git a/docs/book/src/tasks/kubeadm-bootstrap.md b/docs/book/src/tasks/kubeadm-bootstrap.md index 214143c90448..82f2f3b47b86 100644 --- a/docs/book/src/tasks/kubeadm-bootstrap.md +++ b/docs/book/src/tasks/kubeadm-bootstrap.md @@ -86,6 +86,9 @@ The cloud-init script will be saved into a secret `KubeadmConfig.Status.DataSecr The `KubeadmConfig` object allows full control of Kubeadm init/join operations by exposing raw `InitConfiguration`, `ClusterConfiguration` and `JoinConfiguration` objects. +`InitConfiguration` and `JoinConfiguration` exposes `Patches` field which can be used to specify the patches from a directory, +this support is available from K8s 1.22 version onwards. + CABPK will fill in some values if they are left empty with sensible defaults: | `KubeadmConfig` field | Default |