Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions api/bootstrap/kubeadm/v1beta1/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ func Convert_v1beta1_KubeadmConfigSpec_To_v1beta2_KubeadmConfigSpec(in *KubeadmC
return autoConvert_v1beta1_KubeadmConfigSpec_To_v1beta2_KubeadmConfigSpec(in, out, s)
}

func Convert_v1beta1_ClusterConfiguration_To_v1beta2_ClusterConfiguration(in *ClusterConfiguration, out *bootstrapv1.ClusterConfiguration, s apimachineryconversion.Scope) error {
return autoConvert_v1beta1_ClusterConfiguration_To_v1beta2_ClusterConfiguration(in, out, s)
}

func Convert_v1beta1_ControlPlaneComponent_To_v1beta2_ControlPlaneComponent(in *ControlPlaneComponent, out *bootstrapv1.ControlPlaneComponent, s apimachineryconversion.Scope) error {
out.ExtraArgs = bootstrapv1.ConvertToArgs(in.ExtraArgs)
return autoConvert_v1beta1_ControlPlaneComponent_To_v1beta2_ControlPlaneComponent(in, out, s)
Expand Down
14 changes: 14 additions & 0 deletions api/bootstrap/kubeadm/v1beta1/conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func KubeadmConfigFuzzFuncs(_ runtimeserializer.CodecFactory) []interface{} {
spokeDiscovery,
spokeKubeadmConfigSpec,
spokeKubeadmConfigStatus,
spokeClusterConfiguration,
hubBootstrapTokenString,
spokeBootstrapTokenString,
hubKubeadmConfigSpec,
Expand All @@ -71,6 +72,7 @@ func KubeadmConfigTemplateFuzzFuncs(_ runtimeserializer.CodecFactory) []interfac
spokeAPIServer,
spokeDiscovery,
spokeKubeadmConfigSpec,
spokeClusterConfiguration,
spokeBootstrapTokenString,
hubBootstrapTokenString,
hubKubeadmConfigSpec,
Expand Down Expand Up @@ -131,6 +133,18 @@ func spokeKubeadmConfigSpec(in *KubeadmConfigSpec, c randfill.Continue) {
in.UseExperimentalRetryJoin = false
}

func spokeClusterConfiguration(in *ClusterConfiguration, c randfill.Continue) {
c.FillNoCustom(in)

// Drop the following fields as they have been removed in v1beta2, so we don't have to preserve them.
in.Networking.ServiceSubnet = ""
in.Networking.PodSubnet = ""
in.Networking.DNSDomain = ""
in.KubernetesVersion = ""
in.ControlPlaneEndpoint = ""
in.ClusterName = ""
}

func spokeAPIServer(in *APIServer, c randfill.Continue) {
c.FillNoCustom(in)

Expand Down
65 changes: 9 additions & 56 deletions api/bootstrap/kubeadm/v1beta1/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 0 additions & 58 deletions api/bootstrap/kubeadm/v1beta2/kubeadm_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,35 +130,6 @@ type ClusterConfiguration struct {
// +optional
Etcd Etcd `json:"etcd,omitempty"`

// networking holds configuration for the networking topology of the cluster.
// NB: This value defaults to the Cluster object spec.clusterNetwork.
// +optional
Networking Networking `json:"networking,omitempty"`

// kubernetesVersion is the target version of the control plane.
// NB: This value defaults to the Machine object spec.version
// +optional
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=256
KubernetesVersion string `json:"kubernetesVersion,omitempty"`

// controlPlaneEndpoint sets a stable IP address or DNS name for the control plane; it
// can be a valid IP address or a RFC-1123 DNS subdomain, both with optional TCP port.
// In case the ControlPlaneEndpoint is not specified, the AdvertiseAddress + BindPort
// are used; in case the ControlPlaneEndpoint is specified but without a TCP port,
// the BindPort is used.
// Possible usages are:
// e.g. In a cluster with more than one control plane instances, this field should be
// assigned the address of the external load balancer in front of the
// control plane instances.
// e.g. in environments with enforced node recycling, the ControlPlaneEndpoint
// could be used for assigning a stable DNS to the control plane.
// NB: This value defaults to the first value in the Cluster object status.apiEndpoints array.
// +optional
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=512
ControlPlaneEndpoint string `json:"controlPlaneEndpoint,omitempty"`

// apiServer contains extra settings for the API server control plane component
// +optional
APIServer APIServer `json:"apiServer,omitempty"`
Expand Down Expand Up @@ -201,12 +172,6 @@ type ClusterConfiguration struct {
// featureGates enabled by the user.
// +optional
FeatureGates map[string]bool `json:"featureGates,omitempty"`

// clusterName is the cluster name
// +optional
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=63
ClusterName string `json:"clusterName,omitempty"`
}

// ControlPlaneComponent holds settings common to control plane component of the cluster.
Expand Down Expand Up @@ -416,29 +381,6 @@ func (n *NodeRegistrationOptions) MarshalJSON() ([]byte, error) {
})
}

// Networking contains elements describing cluster's networking configuration.
type Networking struct {
// serviceSubnet is the subnet used by k8s services.
// Defaults to a comma-delimited string of the Cluster object's spec.clusterNetwork.pods.cidrBlocks, or
// to "10.96.0.0/12" if that's unset.
// +optional
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=1024
ServiceSubnet string `json:"serviceSubnet,omitempty"`
// podSubnet is the subnet used by pods.
// If unset, the API server will not allocate CIDR ranges for every node.
// Defaults to a comma-delimited string of the Cluster object's spec.clusterNetwork.services.cidrBlocks if that is set
// +optional
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=1024
PodSubnet string `json:"podSubnet,omitempty"`
// dnsDomain is the dns domain used by k8s services. Defaults to "cluster.local".
// +optional
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=253
DNSDomain string `json:"dnsDomain,omitempty"`
}

// BootstrapToken describes one bootstrap token, stored as a Secret in the cluster.
type BootstrapToken struct {
// token is used for establishing bidirectional trust between nodes and control-planes.
Expand Down
16 changes: 0 additions & 16 deletions api/bootstrap/kubeadm/v1beta2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions api/controlplane/kubeadm/v1beta1/conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func KubeadmControlPlaneFuzzFuncs(_ runtimeserializer.CodecFactory) []interface{
hubKubeadmControlPlaneStatus,
spokeKubeadmControlPlaneStatus,
spokeKubeadmConfigSpec,
spokeClusterConfiguration,
hubBootstrapTokenString,
spokeBootstrapTokenString,
spokeAPIServer,
Expand All @@ -71,6 +72,7 @@ func KubeadmControlPlaneFuzzFuncs(_ runtimeserializer.CodecFactory) []interface{
func KubeadmControlPlaneTemplateFuzzFuncs(_ runtimeserializer.CodecFactory) []interface{} {
return []interface{}{
spokeKubeadmConfigSpec,
spokeClusterConfiguration,
hubBootstrapTokenString,
spokeBootstrapTokenString,
spokeAPIServer,
Expand Down Expand Up @@ -167,3 +169,15 @@ func spokeKubeadmConfigSpec(in *bootstrapv1beta1.KubeadmConfigSpec, c randfill.C
// Drop UseExperimentalRetryJoin as we intentionally don't preserve it.
in.UseExperimentalRetryJoin = false
}

func spokeClusterConfiguration(in *bootstrapv1beta1.ClusterConfiguration, c randfill.Continue) {
c.FillNoCustom(in)

// Drop the following fields as they have been removed in v1beta2, so we don't have to preserve them.
in.Networking.ServiceSubnet = ""
in.Networking.PodSubnet = ""
in.Networking.DNSDomain = ""
in.KubernetesVersion = ""
in.ControlPlaneEndpoint = ""
in.ClusterName = ""
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading