From 4f814782f004e84793f44b9dff84121abd44c57f Mon Sep 17 00:00:00 2001 From: Rajashree Mandaogane Date: Sun, 21 Nov 2021 20:59:58 -0800 Subject: [PATCH 09/34] Add bottlerocket changes to capbk v1alpha4 api --- .../kubeadm/api/v1alpha4/kubeadm_types.go | 72 ++++++++++ .../api/v1alpha4/zz_generated.deepcopy.go | 75 +++++++++++ .../api/v1beta1/zz_generated.deepcopy.go | 75 +++++++++++ ...strap.cluster.x-k8s.io_kubeadmconfigs.yaml | 110 ++++++++++++++++ ...uster.x-k8s.io_kubeadmconfigtemplates.yaml | 118 +++++++++++++++++ .../kubeadm/types/upstreamv1beta2/types.go | 72 ++++++++++ .../kubeadm/types/upstreamv1beta3/types.go | 72 ++++++++++ ...cluster.x-k8s.io_kubeadmcontrolplanes.yaml | 118 +++++++++++++++++ ...x-k8s.io_kubeadmcontrolplanetemplates.yaml | 124 ++++++++++++++++++ 9 files changed, 836 insertions(+) diff --git a/bootstrap/kubeadm/api/v1alpha4/kubeadm_types.go b/bootstrap/kubeadm/api/v1alpha4/kubeadm_types.go index 6e91e00ae..29df78f5c 100644 --- a/bootstrap/kubeadm/api/v1alpha4/kubeadm_types.go +++ b/bootstrap/kubeadm/api/v1alpha4/kubeadm_types.go @@ -61,6 +61,26 @@ type InitConfiguration struct { type ClusterConfiguration struct { metav1.TypeMeta `json:",inline"` + // Pause holds the image source for pause container + // This is only for bottlerocket + // +optional + Pause Pause `json:"pause,omitempty"` + + // BottlerocketBootstrap holds the image source for kubeadm bootstrap container + // This is only for bottlerocket + // +optional + BottlerocketBootstrap BottlerocketBootstrap `json:"bottlerocketBootstrap,omitempty"` + + // Proxy holds the https and no proxy information + // This is only for bottlerocket + // +optional + Proxy ProxyConfiguration `json:"proxy,omitempty"` + + // RegistryMirror holds the image registry mirror information + // This is only for bottlerocket + // +optional + RegistryMirror RegistryMirrorConfiguration `json:"registryMirror,omitempty"` + // Etcd holds configuration for etcd. // NB: This value defaults to a Local (stacked) etcd // +optional @@ -128,6 +148,38 @@ type ClusterConfiguration struct { ClusterName string `json:"clusterName,omitempty"` } +// Pause defines the pause image repo and tag that should be run on the bootstrapped nodes. +// This setting is ONLY for bottlerocket nodes, as this needs to be set pre-boot time along with user-data +type Pause struct { + // ImageMeta allows to customize the image used for the Pause component + ImageMeta `json:",inline"` +} + +// BottlerocketBootstrap holds the settings of kubeadm bootstrap container for bottlerocket nodes +// This setting is ONLY for bottlerocket nodes. +type BottlerocketBootstrap struct { + // ImageMeta allows to customize the image used for the BottlerocketBootstrap component + ImageMeta `json:",inline"` +} + +// ProxyConfiguration holds the settings for proxying bottlerocket services +type ProxyConfiguration struct { + // HTTPS proxy + HTTPSProxy string `json:"httpsProxy,omitempty"` + + // No proxy, list of ips that should not use proxy + NoProxy []string `json:"noProxy,omitempty"` +} + +// RegistryMirrorConfiguration holds the settings for image registry mirror +type RegistryMirrorConfiguration struct { + // Endpoint defines the registry mirror endpoint to use for pulling images + Endpoint string `json:"endpoint,omitempty"` + + // CACert defines the CA cert for the registry mirror + CACert string `json:"caCert,omitempty"` +} + // ControlPlaneComponent holds settings common to control plane component of the cluster. type ControlPlaneComponent struct { // ExtraArgs is an extra set of flags to pass to the control plane component. @@ -338,6 +390,26 @@ type ExternalEtcd struct { type JoinConfiguration struct { metav1.TypeMeta `json:",inline"` + // Pause holds the image source for pause container + // This is only for bottlerocket + // +optional + Pause Pause `json:"pause,omitempty"` + + // BottlerocketBootstrap holds the image source for kubeadm bootstrap container + // This is only for bottlerocket + // +optional + BottlerocketBootstrap BottlerocketBootstrap `json:"bottlerocketBootstrap,omitempty"` + + // Proxy holds the https and no proxy information + // This is only for bottlerocket + // +optional + Proxy ProxyConfiguration `json:"proxy,omitempty"` + + // RegistryMirror holds the image registry mirror information + // This is only for bottlerocket + // +optional + RegistryMirror RegistryMirrorConfiguration `json:"registryMirror,omitempty"` + // NodeRegistration holds fields that relate to registering the new control-plane node to the cluster. // When used in the context of control plane nodes, NodeRegistration should remain consistent // across both InitConfiguration and JoinConfiguration diff --git a/bootstrap/kubeadm/api/v1alpha4/zz_generated.deepcopy.go b/bootstrap/kubeadm/api/v1alpha4/zz_generated.deepcopy.go index 3247cbbd9..334d940ca 100644 --- a/bootstrap/kubeadm/api/v1alpha4/zz_generated.deepcopy.go +++ b/bootstrap/kubeadm/api/v1alpha4/zz_generated.deepcopy.go @@ -143,10 +143,30 @@ func (in *BootstrapTokenString) DeepCopy() *BootstrapTokenString { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BottlerocketBootstrap) DeepCopyInto(out *BottlerocketBootstrap) { + *out = *in + out.ImageMeta = in.ImageMeta +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BottlerocketBootstrap. +func (in *BottlerocketBootstrap) DeepCopy() *BottlerocketBootstrap { + if in == nil { + return nil + } + out := new(BottlerocketBootstrap) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterConfiguration) DeepCopyInto(out *ClusterConfiguration) { *out = *in out.TypeMeta = in.TypeMeta + out.Pause = in.Pause + out.BottlerocketBootstrap = in.BottlerocketBootstrap + in.Proxy.DeepCopyInto(&out.Proxy) + out.RegistryMirror = in.RegistryMirror in.Etcd.DeepCopyInto(&out.Etcd) out.Networking = in.Networking in.APIServer.DeepCopyInto(&out.APIServer) @@ -511,6 +531,10 @@ func (in *InitConfiguration) DeepCopyObject() runtime.Object { func (in *JoinConfiguration) DeepCopyInto(out *JoinConfiguration) { *out = *in out.TypeMeta = in.TypeMeta + out.Pause = in.Pause + out.BottlerocketBootstrap = in.BottlerocketBootstrap + in.Proxy.DeepCopyInto(&out.Proxy) + out.RegistryMirror = in.RegistryMirror in.NodeRegistration.DeepCopyInto(&out.NodeRegistration) in.Discovery.DeepCopyInto(&out.Discovery) if in.ControlPlane != nil { @@ -961,6 +985,57 @@ func (in *Partition) DeepCopy() *Partition { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Pause) DeepCopyInto(out *Pause) { + *out = *in + out.ImageMeta = in.ImageMeta +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Pause. +func (in *Pause) DeepCopy() *Pause { + if in == nil { + return nil + } + out := new(Pause) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxyConfiguration) DeepCopyInto(out *ProxyConfiguration) { + *out = *in + if in.NoProxy != nil { + in, out := &in.NoProxy, &out.NoProxy + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyConfiguration. +func (in *ProxyConfiguration) DeepCopy() *ProxyConfiguration { + if in == nil { + return nil + } + out := new(ProxyConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RegistryMirrorConfiguration) DeepCopyInto(out *RegistryMirrorConfiguration) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistryMirrorConfiguration. +func (in *RegistryMirrorConfiguration) DeepCopy() *RegistryMirrorConfiguration { + if in == nil { + return nil + } + out := new(RegistryMirrorConfiguration) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SecretFileSource) DeepCopyInto(out *SecretFileSource) { *out = *in diff --git a/bootstrap/kubeadm/api/v1beta1/zz_generated.deepcopy.go b/bootstrap/kubeadm/api/v1beta1/zz_generated.deepcopy.go index 588c218d2..a77749836 100644 --- a/bootstrap/kubeadm/api/v1beta1/zz_generated.deepcopy.go +++ b/bootstrap/kubeadm/api/v1beta1/zz_generated.deepcopy.go @@ -143,10 +143,30 @@ func (in *BootstrapTokenString) DeepCopy() *BootstrapTokenString { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BottlerocketBootstrap) DeepCopyInto(out *BottlerocketBootstrap) { + *out = *in + out.ImageMeta = in.ImageMeta +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BottlerocketBootstrap. +func (in *BottlerocketBootstrap) DeepCopy() *BottlerocketBootstrap { + if in == nil { + return nil + } + out := new(BottlerocketBootstrap) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterConfiguration) DeepCopyInto(out *ClusterConfiguration) { *out = *in out.TypeMeta = in.TypeMeta + out.Pause = in.Pause + out.BottlerocketBootstrap = in.BottlerocketBootstrap + in.Proxy.DeepCopyInto(&out.Proxy) + out.RegistryMirror = in.RegistryMirror in.Etcd.DeepCopyInto(&out.Etcd) out.Networking = in.Networking in.APIServer.DeepCopyInto(&out.APIServer) @@ -556,6 +576,10 @@ func (in *InitConfiguration) DeepCopyObject() runtime.Object { func (in *JoinConfiguration) DeepCopyInto(out *JoinConfiguration) { *out = *in out.TypeMeta = in.TypeMeta + out.Pause = in.Pause + out.BottlerocketBootstrap = in.BottlerocketBootstrap + in.Proxy.DeepCopyInto(&out.Proxy) + out.RegistryMirror = in.RegistryMirror in.NodeRegistration.DeepCopyInto(&out.NodeRegistration) in.Discovery.DeepCopyInto(&out.Discovery) if in.ControlPlane != nil { @@ -1053,6 +1077,57 @@ func (in *Patches) DeepCopy() *Patches { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Pause) DeepCopyInto(out *Pause) { + *out = *in + out.ImageMeta = in.ImageMeta +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Pause. +func (in *Pause) DeepCopy() *Pause { + if in == nil { + return nil + } + out := new(Pause) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxyConfiguration) DeepCopyInto(out *ProxyConfiguration) { + *out = *in + if in.NoProxy != nil { + in, out := &in.NoProxy, &out.NoProxy + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyConfiguration. +func (in *ProxyConfiguration) DeepCopy() *ProxyConfiguration { + if in == nil { + return nil + } + out := new(ProxyConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RegistryMirrorConfiguration) DeepCopyInto(out *RegistryMirrorConfiguration) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistryMirrorConfiguration. +func (in *RegistryMirrorConfiguration) DeepCopy() *RegistryMirrorConfiguration { + if in == nil { + return nil + } + out := new(RegistryMirrorConfiguration) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SecretFileSource) DeepCopyInto(out *SecretFileSource) { *out = *in 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 15413b5dc..2b856fa95 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 @@ -1209,6 +1209,21 @@ spec: schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string + bottlerocketBootstrap: + description: BottlerocketBootstrap holds the image source for + kubeadm bootstrap container This is only for bottlerocket + properties: + imageRepository: + description: ImageRepository sets the container registry to + pull images from. if not set, the ImageRepository defined + in ClusterConfiguration will be used instead. + type: string + imageTag: + description: ImageTag allows to specify a tag for the image. + In case this value is set, kubeadm does not change automatically + the version of the above components during upgrades. + type: string + type: object certificatesDir: description: 'CertificatesDir specifies where to store or look for all required certificates. NB: if not provided, this will @@ -1409,6 +1424,46 @@ spec: if that's unset. type: string type: object + pause: + description: Pause holds the image source for pause container + This is only for bottlerocket + properties: + imageRepository: + description: ImageRepository sets the container registry to + pull images from. if not set, the ImageRepository defined + in ClusterConfiguration will be used instead. + type: string + imageTag: + description: ImageTag allows to specify a tag for the image. + In case this value is set, kubeadm does not change automatically + the version of the above components during upgrades. + type: string + type: object + proxy: + description: Proxy holds the https and no proxy information This + is only for bottlerocket + properties: + httpsProxy: + description: HTTPS proxy + type: string + noProxy: + description: No proxy, list of ips that should not use proxy + items: + type: string + type: array + type: object + registryMirror: + description: RegistryMirror holds the image registry mirror information + This is only for bottlerocket + properties: + caCert: + description: CACert defines the CA cert for the registry mirror + type: string + endpoint: + description: Endpoint defines the registry mirror endpoint + to use for pulling images + type: string + type: object scheduler: description: Scheduler contains extra settings for the scheduler control plane component @@ -1762,6 +1817,21 @@ spec: schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string + bottlerocketBootstrap: + description: BottlerocketBootstrap holds the image source for + kubeadm bootstrap container This is only for bottlerocket + properties: + imageRepository: + description: ImageRepository sets the container registry to + pull images from. if not set, the ImageRepository defined + in ClusterConfiguration will be used instead. + type: string + imageTag: + description: ImageTag allows to specify a tag for the image. + In case this value is set, kubeadm does not change automatically + the version of the above components during upgrades. + type: string + type: object caCertPath: description: 'CACertPath is the path to the SSL certificate authority used to secure comunications between node and control-plane. @@ -1933,6 +2003,46 @@ spec: type: object type: array type: object + pause: + description: Pause holds the image source for pause container + This is only for bottlerocket + properties: + imageRepository: + description: ImageRepository sets the container registry to + pull images from. if not set, the ImageRepository defined + in ClusterConfiguration will be used instead. + type: string + imageTag: + description: ImageTag allows to specify a tag for the image. + In case this value is set, kubeadm does not change automatically + the version of the above components during upgrades. + type: string + type: object + proxy: + description: Proxy holds the https and no proxy information This + is only for bottlerocket + properties: + httpsProxy: + description: HTTPS proxy + type: string + noProxy: + description: No proxy, list of ips that should not use proxy + items: + type: string + type: array + type: object + registryMirror: + description: RegistryMirror holds the image registry mirror information + This is only for bottlerocket + properties: + caCert: + description: CACert defines the CA cert for the registry mirror + type: string + endpoint: + description: Endpoint defines the registry mirror endpoint + to use for pulling images + type: string + type: object type: object mounts: description: Mounts specifies a list of mount points to be setup. 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 b4f286dd6..72ba11e8e 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 @@ -1213,6 +1213,22 @@ spec: convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string + bottlerocketBootstrap: + description: BottlerocketBootstrap holds the image source + for kubeadm bootstrap container This is only for bottlerocket + properties: + imageRepository: + description: ImageRepository sets the container registry + to pull images from. if not set, the ImageRepository + defined in ClusterConfiguration will be used instead. + type: string + imageTag: + description: ImageTag allows to specify a tag for + the image. In case this value is set, kubeadm does + not change automatically the version of the above + components during upgrades. + type: string + type: object certificatesDir: description: 'CertificatesDir specifies where to store or look for all required certificates. NB: if not provided, @@ -1427,6 +1443,49 @@ spec: or to "10.96.0.0/12" if that's unset. type: string type: object + pause: + description: Pause holds the image source for pause container + This is only for bottlerocket + properties: + imageRepository: + description: ImageRepository sets the container registry + to pull images from. if not set, the ImageRepository + defined in ClusterConfiguration will be used instead. + type: string + imageTag: + description: ImageTag allows to specify a tag for + the image. In case this value is set, kubeadm does + not change automatically the version of the above + components during upgrades. + type: string + type: object + proxy: + description: Proxy holds the https and no proxy information + This is only for bottlerocket + properties: + httpsProxy: + description: HTTPS proxy + type: string + noProxy: + description: No proxy, list of ips that should not + use proxy + items: + type: string + type: array + type: object + registryMirror: + description: RegistryMirror holds the image registry mirror + information This is only for bottlerocket + properties: + caCert: + description: CACert defines the CA cert for the registry + mirror + type: string + endpoint: + description: Endpoint defines the registry mirror + endpoint to use for pulling images + type: string + type: object scheduler: description: Scheduler contains extra settings for the scheduler control plane component @@ -1802,6 +1861,22 @@ spec: convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string + bottlerocketBootstrap: + description: BottlerocketBootstrap holds the image source + for kubeadm bootstrap container This is only for bottlerocket + properties: + imageRepository: + description: ImageRepository sets the container registry + to pull images from. if not set, the ImageRepository + defined in ClusterConfiguration will be used instead. + type: string + imageTag: + description: ImageTag allows to specify a tag for + the image. In case this value is set, kubeadm does + not change automatically the version of the above + components during upgrades. + type: string + type: object caCertPath: description: 'CACertPath is the path to the SSL certificate authority used to secure comunications between node @@ -1985,6 +2060,49 @@ spec: type: object type: array type: object + pause: + description: Pause holds the image source for pause container + This is only for bottlerocket + properties: + imageRepository: + description: ImageRepository sets the container registry + to pull images from. if not set, the ImageRepository + defined in ClusterConfiguration will be used instead. + type: string + imageTag: + description: ImageTag allows to specify a tag for + the image. In case this value is set, kubeadm does + not change automatically the version of the above + components during upgrades. + type: string + type: object + proxy: + description: Proxy holds the https and no proxy information + This is only for bottlerocket + properties: + httpsProxy: + description: HTTPS proxy + type: string + noProxy: + description: No proxy, list of ips that should not + use proxy + items: + type: string + type: array + type: object + registryMirror: + description: RegistryMirror holds the image registry mirror + information This is only for bottlerocket + properties: + caCert: + description: CACert defines the CA cert for the registry + mirror + type: string + endpoint: + description: Endpoint defines the registry mirror + endpoint to use for pulling images + type: string + type: object type: object mounts: description: Mounts specifies a list of mount points to be diff --git a/bootstrap/kubeadm/types/upstreamv1beta2/types.go b/bootstrap/kubeadm/types/upstreamv1beta2/types.go index 413f6fe9b..ff9a01d04 100644 --- a/bootstrap/kubeadm/types/upstreamv1beta2/types.go +++ b/bootstrap/kubeadm/types/upstreamv1beta2/types.go @@ -64,6 +64,26 @@ type InitConfiguration struct { type ClusterConfiguration struct { metav1.TypeMeta `json:",inline"` + // Pause holds the image source for pause container + // This is only for bottlerocket + // +optional + Pause Pause `json:"pause,omitempty"` + + // BottlerocketBootstrap holds the image source for kubeadm bootstrap container + // This is only for bottlerocket + // +optional + BottlerocketBootstrap BottlerocketBootstrap `json:"bottlerocketBootstrap,omitempty"` + + // Proxy holds the https and no proxy information + // This is only for bottlerocket + // +optional + Proxy ProxyConfiguration `json:"proxy,omitempty"` + + // RegistryMirror holds the image registry mirror information + // This is only for bottlerocket + // +optional + RegistryMirror RegistryMirrorConfiguration `json:"registryMirror,omitempty"` + // Etcd holds configuration for etcd. // NB: This value defaults to a Local (stacked) etcd // +optional @@ -138,6 +158,38 @@ type ClusterConfiguration struct { ClusterName string `json:"clusterName,omitempty"` } +// Pause defines the pause image repo and tag that should be run on the bootstrapped nodes. +// This setting is ONLY for bottlerocket nodes, as this needs to be set pre-boot time along with user-data +type Pause struct { + // ImageMeta allows to customize the image used for the Pause component + ImageMeta `json:",inline"` +} + +// BottlerocketBootstrap holds the settings of kubeadm bootstrap container for bottlerocket nodes +// This setting is ONLY for bottlerocket nodes. +type BottlerocketBootstrap struct { + // ImageMeta allows to customize the image used for the BottlerocketBootstrap component + ImageMeta `json:",inline"` +} + +// ProxyConfiguration holds the settings for proxying bottlerocket services +type ProxyConfiguration struct { + // HTTPS proxy + HTTPSProxy string `json:"httpsProxy,omitempty"` + + // No proxy, list of ips that should not use proxy + NoProxy []string `json:"noProxy,omitempty"` +} + +// RegistryMirrorConfiguration holds the settings for image registry mirror +type RegistryMirrorConfiguration struct { + // Endpoint defines the registry mirror endpoint to use for pulling images + Endpoint string `json:"endpoint,omitempty"` + + // CACert defines the CA cert for the registry mirror + CACert string `json:"caCert,omitempty"` +} + // ControlPlaneComponent holds settings common to control plane component of the cluster. type ControlPlaneComponent struct { // ExtraArgs is an extra set of flags to pass to the control plane component. @@ -349,6 +401,26 @@ type ExternalEtcd struct { type JoinConfiguration struct { metav1.TypeMeta `json:",inline"` + // Pause holds the image source for pause container + // This is only for bottlerocket + // +optional + Pause Pause `json:"pause,omitempty"` + + // BottlerocketBootstrap holds the image source for kubeadm bootstrap container + // This is only for bottlerocket + // +optional + BottlerocketBootstrap BottlerocketBootstrap `json:"bottlerocketBootstrap,omitempty"` + + // Proxy holds the https and no proxy information + // This is only for bottlerocket + // +optional + Proxy ProxyConfiguration `json:"proxy,omitempty"` + + // RegistryMirror holds the image registry mirror information + // This is only for bottlerocket + // +optional + RegistryMirror RegistryMirrorConfiguration `json:"registryMirror,omitempty"` + // NodeRegistration holds fields that relate to registering the new control-plane node to the cluster. // When used in the context of control plane nodes, NodeRegistration should remain consistent // across both InitConfiguration and JoinConfiguration diff --git a/bootstrap/kubeadm/types/upstreamv1beta3/types.go b/bootstrap/kubeadm/types/upstreamv1beta3/types.go index abc993a88..42bda5ca0 100644 --- a/bootstrap/kubeadm/types/upstreamv1beta3/types.go +++ b/bootstrap/kubeadm/types/upstreamv1beta3/types.go @@ -73,6 +73,26 @@ type InitConfiguration struct { type ClusterConfiguration struct { metav1.TypeMeta `json:",inline"` + // Pause holds the image source for pause container + // This is only for bottlerocket + // +optional + Pause Pause `json:"pause,omitempty"` + + // BottlerocketBootstrap holds the image source for kubeadm bootstrap container + // This is only for bottlerocket + // +optional + BottlerocketBootstrap BottlerocketBootstrap `json:"bottlerocketBootstrap,omitempty"` + + // Proxy holds the https and no proxy information + // This is only for bottlerocket + // +optional + Proxy ProxyConfiguration `json:"proxy,omitempty"` + + // RegistryMirror holds the image registry mirror information + // This is only for bottlerocket + // +optional + RegistryMirror RegistryMirrorConfiguration `json:"registryMirror,omitempty"` + // Etcd holds configuration for etcd. // +optional Etcd Etcd `json:"etcd,omitempty"` @@ -135,6 +155,38 @@ type ClusterConfiguration struct { ClusterName string `json:"clusterName,omitempty"` } +// Pause defines the pause image repo and tag that should be run on the bootstrapped nodes. +// This setting is ONLY for bottlerocket nodes, as this needs to be set pre-boot time along with user-data +type Pause struct { + // ImageMeta allows to customize the image used for the Pause component + ImageMeta `json:",inline"` +} + +// BottlerocketBootstrap holds the settings of kubeadm bootstrap container for bottlerocket nodes +// This setting is ONLY for bottlerocket nodes. +type BottlerocketBootstrap struct { + // ImageMeta allows to customize the image used for the BottlerocketBootstrap component + ImageMeta `json:",inline"` +} + +// ProxyConfiguration holds the settings for proxying bottlerocket services +type ProxyConfiguration struct { + // HTTPS proxy + HTTPSProxy string `json:"httpsProxy,omitempty"` + + // No proxy, list of ips that should not use proxy + NoProxy []string `json:"noProxy,omitempty"` +} + +// RegistryMirrorConfiguration holds the settings for image registry mirror +type RegistryMirrorConfiguration struct { + // Endpoint defines the registry mirror endpoint to use for pulling images + Endpoint string `json:"endpoint,omitempty"` + + // CACert defines the CA cert for the registry mirror + CACert string `json:"caCert,omitempty"` +} + // ControlPlaneComponent holds settings common to control plane component of the cluster. type ControlPlaneComponent struct { // ExtraArgs is an extra set of flags to pass to the control plane component. @@ -335,6 +387,26 @@ type ExternalEtcd struct { type JoinConfiguration struct { metav1.TypeMeta `json:",inline"` + // Pause holds the image source for pause container + // This is only for bottlerocket + // +optional + Pause Pause `json:"pause,omitempty"` + + // BottlerocketBootstrap holds the image source for kubeadm bootstrap container + // This is only for bottlerocket + // +optional + BottlerocketBootstrap BottlerocketBootstrap `json:"bottlerocketBootstrap,omitempty"` + + // Proxy holds the https and no proxy information + // This is only for bottlerocket + // +optional + Proxy ProxyConfiguration `json:"proxy,omitempty"` + + // RegistryMirror holds the image registry mirror information + // This is only for bottlerocket + // +optional + RegistryMirror RegistryMirrorConfiguration `json:"registryMirror,omitempty"` + // NodeRegistration holds fields that relate to registering the new control-plane node to the cluster // +optional NodeRegistration NodeRegistrationOptions `json:"nodeRegistration,omitempty"` 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 a552a9b25..f00836a83 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 @@ -1437,6 +1437,22 @@ spec: schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string + bottlerocketBootstrap: + description: BottlerocketBootstrap holds the image source + for kubeadm bootstrap container This is only for bottlerocket + properties: + imageRepository: + description: ImageRepository sets the container registry + to pull images from. if not set, the ImageRepository + defined in ClusterConfiguration will be used instead. + type: string + imageTag: + description: ImageTag allows to specify a tag for the + image. In case this value is set, kubeadm does not change + automatically the version of the above components during + upgrades. + type: string + type: object certificatesDir: description: 'CertificatesDir specifies where to store or look for all required certificates. NB: if not provided, @@ -1643,6 +1659,49 @@ spec: "10.96.0.0/12" if that's unset. type: string type: object + pause: + description: Pause holds the image source for pause container + This is only for bottlerocket + properties: + imageRepository: + description: ImageRepository sets the container registry + to pull images from. if not set, the ImageRepository + defined in ClusterConfiguration will be used instead. + type: string + imageTag: + description: ImageTag allows to specify a tag for the + image. In case this value is set, kubeadm does not change + automatically the version of the above components during + upgrades. + type: string + type: object + proxy: + description: Proxy holds the https and no proxy information + This is only for bottlerocket + properties: + httpsProxy: + description: HTTPS proxy + type: string + noProxy: + description: No proxy, list of ips that should not use + proxy + items: + type: string + type: array + type: object + registryMirror: + description: RegistryMirror holds the image registry mirror + information This is only for bottlerocket + properties: + caCert: + description: CACert defines the CA cert for the registry + mirror + type: string + endpoint: + description: Endpoint defines the registry mirror endpoint + to use for pulling images + type: string + type: object scheduler: description: Scheduler contains extra settings for the scheduler control plane component @@ -2010,6 +2069,22 @@ spec: schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string + bottlerocketBootstrap: + description: BottlerocketBootstrap holds the image source + for kubeadm bootstrap container This is only for bottlerocket + properties: + imageRepository: + description: ImageRepository sets the container registry + to pull images from. if not set, the ImageRepository + defined in ClusterConfiguration will be used instead. + type: string + imageTag: + description: ImageTag allows to specify a tag for the + image. In case this value is set, kubeadm does not change + automatically the version of the above components during + upgrades. + type: string + type: object caCertPath: description: 'CACertPath is the path to the SSL certificate authority used to secure comunications between node and @@ -2188,6 +2263,49 @@ spec: type: object type: array type: object + pause: + description: Pause holds the image source for pause container + This is only for bottlerocket + properties: + imageRepository: + description: ImageRepository sets the container registry + to pull images from. if not set, the ImageRepository + defined in ClusterConfiguration will be used instead. + type: string + imageTag: + description: ImageTag allows to specify a tag for the + image. In case this value is set, kubeadm does not change + automatically the version of the above components during + upgrades. + type: string + type: object + proxy: + description: Proxy holds the https and no proxy information + This is only for bottlerocket + properties: + httpsProxy: + description: HTTPS proxy + type: string + noProxy: + description: No proxy, list of ips that should not use + proxy + items: + type: string + type: array + type: object + registryMirror: + description: RegistryMirror holds the image registry mirror + information This is only for bottlerocket + properties: + caCert: + description: CACert defines the CA cert for the registry + mirror + type: string + endpoint: + description: Endpoint defines the registry mirror endpoint + to use for pulling images + type: string + type: object type: object mounts: description: Mounts specifies a list of mount points to be setup. 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 5410d4145..c96b0409c 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 @@ -125,6 +125,24 @@ spec: value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string + bottlerocketBootstrap: + description: BottlerocketBootstrap holds the image + source for kubeadm bootstrap container This is only + for bottlerocket + properties: + imageRepository: + description: ImageRepository sets the container + registry to pull images from. if not set, the + ImageRepository defined in ClusterConfiguration + will be used instead. + type: string + imageTag: + description: ImageTag allows to specify a tag + for the image. In case this value is set, kubeadm + does not change automatically the version of + the above components during upgrades. + type: string + type: object certificatesDir: description: 'CertificatesDir specifies where to store or look for all required certificates. NB: if not @@ -347,6 +365,50 @@ spec: or to "10.96.0.0/12" if that's unset. type: string type: object + pause: + description: Pause holds the image source for pause + container This is only for bottlerocket + properties: + imageRepository: + description: ImageRepository sets the container + registry to pull images from. if not set, the + ImageRepository defined in ClusterConfiguration + will be used instead. + type: string + imageTag: + description: ImageTag allows to specify a tag + for the image. In case this value is set, kubeadm + does not change automatically the version of + the above components during upgrades. + type: string + type: object + proxy: + description: Proxy holds the https and no proxy information + This is only for bottlerocket + properties: + httpsProxy: + description: HTTPS proxy + type: string + noProxy: + description: No proxy, list of ips that should + not use proxy + items: + type: string + type: array + type: object + registryMirror: + description: RegistryMirror holds the image registry + mirror information This is only for bottlerocket + properties: + caCert: + description: CACert defines the CA cert for the + registry mirror + type: string + endpoint: + description: Endpoint defines the registry mirror + endpoint to use for pulling images + type: string + type: object scheduler: description: Scheduler contains extra settings for the scheduler control plane component @@ -738,6 +800,24 @@ spec: value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string + bottlerocketBootstrap: + description: BottlerocketBootstrap holds the image + source for kubeadm bootstrap container This is only + for bottlerocket + properties: + imageRepository: + description: ImageRepository sets the container + registry to pull images from. if not set, the + ImageRepository defined in ClusterConfiguration + will be used instead. + type: string + imageTag: + description: ImageTag allows to specify a tag + for the image. In case this value is set, kubeadm + does not change automatically the version of + the above components during upgrades. + type: string + type: object caCertPath: description: 'CACertPath is the path to the SSL certificate authority used to secure comunications between node @@ -929,6 +1009,50 @@ spec: type: object type: array type: object + pause: + description: Pause holds the image source for pause + container This is only for bottlerocket + properties: + imageRepository: + description: ImageRepository sets the container + registry to pull images from. if not set, the + ImageRepository defined in ClusterConfiguration + will be used instead. + type: string + imageTag: + description: ImageTag allows to specify a tag + for the image. In case this value is set, kubeadm + does not change automatically the version of + the above components during upgrades. + type: string + type: object + proxy: + description: Proxy holds the https and no proxy information + This is only for bottlerocket + properties: + httpsProxy: + description: HTTPS proxy + type: string + noProxy: + description: No proxy, list of ips that should + not use proxy + items: + type: string + type: array + type: object + registryMirror: + description: RegistryMirror holds the image registry + mirror information This is only for bottlerocket + properties: + caCert: + description: CACert defines the CA cert for the + registry mirror + type: string + endpoint: + description: Endpoint defines the registry mirror + endpoint to use for pulling images + type: string + type: object type: object mounts: description: Mounts specifies a list of mount points to -- 2.40.0