diff --git a/pkg/providers/cloudstack/config/template-cp.yaml b/pkg/providers/cloudstack/config/template-cp.yaml index d6532c05adcd..54826fb7b233 100644 --- a/pkg/providers/cloudstack/config/template-cp.yaml +++ b/pkg/providers/cloudstack/config/template-cp.yaml @@ -352,6 +352,10 @@ spec: else echo "{{$dir}} already symlnk"; fi {{- end}} +{{- $kube_minor_version := (index (splitList "." (trimPrefix "v" .kubernetesVersion)) 1) }} +{{- if (ge (atoi $kube_minor_version) 29) }} + - "if [ -f /run/kubeadm/kubeadm.yaml ]; then sed -i 's#path: /etc/kubernetes/admin.conf#path: /etc/kubernetes/super-admin.conf#' /etc/kubernetes/manifests/kube-vip.yaml; fi" +{{- end }} {{- if .cloudstackControlPlaneDiskOfferingProvided }} diskSetup: filesystems: diff --git a/pkg/providers/nutanix/config/cp-template.yaml b/pkg/providers/nutanix/config/cp-template.yaml index 7fd763f7af1f..06a647cdc993 100644 --- a/pkg/providers/nutanix/config/cp-template.yaml +++ b/pkg/providers/nutanix/config/cp-template.yaml @@ -325,6 +325,10 @@ spec: - echo "127.0.0.1 {{`{{ ds.meta_data.hostname }}`}}" >> /etc/hosts postKubeadmCommands: - echo export KUBECONFIG=/etc/kubernetes/admin.conf >> /root/.bashrc +{{- $kube_minor_version := (index (splitList "." (trimPrefix "v" .kubernetesVersion)) 1) }} +{{- if (ge (atoi $kube_minor_version) 29) }} + - "if [ -f /run/kubeadm/kubeadm.yaml ]; then sed -i 's#path: /etc/kubernetes/admin.conf#path: /etc/kubernetes/super-admin.conf#' /etc/kubernetes/manifests/kube-vip.yaml; fi" +{{- end }} useExperimentalRetryJoin: true --- apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 diff --git a/pkg/providers/snow/apibuilder.go b/pkg/providers/snow/apibuilder.go index 775ace2f124f..4a5773cbddbb 100644 --- a/pkg/providers/snow/apibuilder.go +++ b/pkg/providers/snow/apibuilder.go @@ -17,6 +17,7 @@ import ( "github.com/aws/eks-anywhere/pkg/clusterapi" "github.com/aws/eks-anywhere/pkg/constants" snowv1 "github.com/aws/eks-anywhere/pkg/providers/snow/api/v1beta1" + "github.com/aws/eks-anywhere/pkg/semver" ) const ( @@ -73,6 +74,21 @@ func KubeadmControlPlane(log logr.Logger, clusterSpec *cluster.Spec, snowMachine kcp.Spec.KubeadmConfigSpec.PreKubeadmCommands = append(kcp.Spec.KubeadmConfigSpec.PreKubeadmCommands, "/etc/eks/bootstrap.sh", ) + kubeVersionSemver, err := semver.New(string(clusterSpec.Cluster.Spec.KubernetesVersion) + ".0") + if err != nil { + return nil, fmt.Errorf("error converting kubeVersion %v to semver %v", clusterSpec.Cluster.Spec.KubernetesVersion, err) + } + + kube129Semver, err := semver.New(string(v1alpha1.Kube129) + ".0") + if err != nil { + return nil, fmt.Errorf("error converting kubeVersion %v to semver %v", v1alpha1.Kube129, err) + } + + if kubeVersionSemver.Compare(kube129Semver) != -1 { + kcp.Spec.KubeadmConfigSpec.PreKubeadmCommands = append(kcp.Spec.KubeadmConfigSpec.PreKubeadmCommands, + "if [ -f /run/kubeadm/kubeadm.yaml ]; then sed -i 's#path: /etc/kubernetes/admin.conf#path: /etc/kubernetes/super-admin.conf#' /etc/kubernetes/manifests/kube-vip.yaml; fi", + ) + } if err := clusterapi.SetProxyConfigInKubeadmControlPlaneForUbuntu(kcp, clusterSpec.Cluster); err != nil { return nil, err diff --git a/pkg/providers/snow/apibuilder_test.go b/pkg/providers/snow/apibuilder_test.go index 6d1bc13bbfc9..afc86e9d4e44 100644 --- a/pkg/providers/snow/apibuilder_test.go +++ b/pkg/providers/snow/apibuilder_test.go @@ -104,9 +104,10 @@ func TestCAPICluster(t *testing.T) { tt.Expect(got).To(Equal(wantCAPICluster())) } -func wantKubeadmControlPlane() *controlplanev1.KubeadmControlPlane { +func wantKubeadmControlPlane(kubeVersion v1alpha1.KubernetesVersion) *controlplanev1.KubeadmControlPlane { wantReplicas := int32(3) wantMaxSurge := intstr.FromInt(1) + versionBundles := givenVersionsBundle(kubeVersion) return &controlplanev1.KubeadmControlPlane{ TypeMeta: metav1.TypeMeta{ APIVersion: "controlplane.cluster.x-k8s.io/v1beta1", @@ -126,18 +127,18 @@ func wantKubeadmControlPlane() *controlplanev1.KubeadmControlPlane { }, KubeadmConfigSpec: bootstrapv1.KubeadmConfigSpec{ ClusterConfiguration: &bootstrapv1.ClusterConfiguration{ - ImageRepository: "public.ecr.aws/eks-distro/kubernetes", + ImageRepository: versionBundles.KubeDistro.Kubernetes.Repository, DNS: bootstrapv1.DNS{ ImageMeta: bootstrapv1.ImageMeta{ - ImageRepository: "public.ecr.aws/eks-distro/coredns", - ImageTag: "v1.8.4-eks-1-21-9", + ImageRepository: versionBundles.KubeDistro.CoreDNS.Repository, + ImageTag: versionBundles.KubeDistro.CoreDNS.Tag, }, }, Etcd: bootstrapv1.Etcd{ Local: &bootstrapv1.LocalEtcd{ ImageMeta: bootstrapv1.ImageMeta{ - ImageRepository: "public.ecr.aws/eks-distro/etcd-io", - ImageTag: "v3.4.16-eks-1-21-9", + ImageRepository: versionBundles.KubeDistro.Etcd.Repository, + ImageTag: versionBundles.KubeDistro.Etcd.Tag, }, ExtraArgs: map[string]string{ "cipher-suites": "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", @@ -196,13 +197,13 @@ func wantKubeadmControlPlane() *controlplanev1.KubeadmControlPlane { }, }, Replicas: &wantReplicas, - Version: "v1.21.5-eks-1-21-9", + Version: versionBundles.KubeDistro.Kubernetes.Tag, }, } } func wantKubeadmControlPlaneUnstackedEtcd() *controlplanev1.KubeadmControlPlane { - kcp := wantKubeadmControlPlane() + kcp := wantKubeadmControlPlane("1.21") kcp.Spec.KubeadmConfigSpec.ClusterConfiguration.Etcd = bootstrapv1.Etcd{ External: &bootstrapv1.ExternalEtcd{ Endpoints: []string{}, @@ -228,7 +229,7 @@ func TestKubeadmControlPlane(t *testing.T) { got, err := snow.KubeadmControlPlane(tt.logger, tt.clusterSpec, controlPlaneMachineTemplate) tt.Expect(err).To(Succeed()) - want := wantKubeadmControlPlane() + want := wantKubeadmControlPlane("1.21") want.Spec.KubeadmConfigSpec.JoinConfiguration.NodeRegistration.IgnorePreflightErrors = []string{"DirAvailable--etc-kubernetes-manifests"} tt.Expect(got).To(BeComparableTo(want)) } @@ -394,7 +395,7 @@ func TestKubeadmControlPlaneWithRegistryMirrorUbuntu(t *testing.T) { controlPlaneMachineTemplate := snow.MachineTemplate("snow-test-control-plane-1", g.machineConfigs[g.clusterSpec.Cluster.Spec.ControlPlaneConfiguration.MachineGroupRef.Name], nil) got, err := snow.KubeadmControlPlane(g.logger, g.clusterSpec, controlPlaneMachineTemplate) g.Expect(err).To(Succeed()) - want := wantKubeadmControlPlane() + want := wantKubeadmControlPlane("1.21") want.Spec.KubeadmConfigSpec.Files = append(want.Spec.KubeadmConfigSpec.Files, tt.wantFiles...) want.Spec.KubeadmConfigSpec.PreKubeadmCommands = append(want.Spec.KubeadmConfigSpec.PreKubeadmCommands, wantRegistryMirrorCommands()...) want.Spec.KubeadmConfigSpec.JoinConfiguration.NodeRegistration.IgnorePreflightErrors = []string{"DirAvailable--etc-kubernetes-manifests"} @@ -451,7 +452,7 @@ func TestKubeadmControlPlaneWithRegistryMirrorBottlerocket(t *testing.T) { controlPlaneMachineTemplate := snow.MachineTemplate("snow-test-control-plane-1", g.machineConfigs["test-cp"], nil) got, err := snow.KubeadmControlPlane(g.logger, g.clusterSpec, controlPlaneMachineTemplate) g.Expect(err).To(Succeed()) - want := wantKubeadmControlPlane() + want := wantKubeadmControlPlane("1.21") want.Spec.KubeadmConfigSpec.Format = "bottlerocket" want.Spec.KubeadmConfigSpec.PreKubeadmCommands = []string{} want.Spec.KubeadmConfigSpec.ClusterConfiguration.BottlerocketBootstrap = bootstrap @@ -548,7 +549,7 @@ func TestKubeadmControlPlaneWithProxyConfigUbuntu(t *testing.T) { controlPlaneMachineTemplate := snow.MachineTemplate("snow-test-control-plane-1", g.machineConfigs[g.clusterSpec.Cluster.Spec.ControlPlaneConfiguration.MachineGroupRef.Name], nil) got, err := snow.KubeadmControlPlane(g.logger, g.clusterSpec, controlPlaneMachineTemplate) g.Expect(err).To(Succeed()) - want := wantKubeadmControlPlane() + want := wantKubeadmControlPlane("1.21") want.Spec.KubeadmConfigSpec.Files = append(want.Spec.KubeadmConfigSpec.Files, tt.wantFiles...) want.Spec.KubeadmConfigSpec.PreKubeadmCommands = append(want.Spec.KubeadmConfigSpec.PreKubeadmCommands, wantProxyConfigCommands()...) want.Spec.KubeadmConfigSpec.JoinConfiguration.NodeRegistration.IgnorePreflightErrors = []string{"DirAvailable--etc-kubernetes-manifests"} @@ -557,6 +558,19 @@ func TestKubeadmControlPlaneWithProxyConfigUbuntu(t *testing.T) { } } +func TestKubeadmControlPlaneUbuntuKubernetes129(t *testing.T) { + tt := newApiBuilerTest(t) + tt.clusterSpec.Cluster.Spec.KubernetesVersion = "1.29" + controlPlaneMachineTemplate := snow.MachineTemplate("snow-test-control-plane-1", tt.machineConfigs[tt.clusterSpec.Cluster.Spec.ControlPlaneConfiguration.MachineGroupRef.Name], nil) + got, err := snow.KubeadmControlPlane(tt.logger, tt.clusterSpec, controlPlaneMachineTemplate) + tt.Expect(err).To(Succeed()) + + want := wantKubeadmControlPlane("1.29") + want.Spec.KubeadmConfigSpec.PreKubeadmCommands = append(want.Spec.KubeadmConfigSpec.PreKubeadmCommands, "if [ -f /run/kubeadm/kubeadm.yaml ]; then sed -i 's#path: /etc/kubernetes/admin.conf#path: /etc/kubernetes/super-admin.conf#' /etc/kubernetes/manifests/kube-vip.yaml; fi") + want.Spec.KubeadmConfigSpec.JoinConfiguration.NodeRegistration.IgnorePreflightErrors = []string{"DirAvailable--etc-kubernetes-manifests"} + tt.Expect(got).To(BeComparableTo(want)) +} + func TestKubeadmControlPlaneWithProxyConfigBottlerocket(t *testing.T) { for _, tt := range proxyTests { t.Run(tt.name, func(t *testing.T) { @@ -566,7 +580,7 @@ func TestKubeadmControlPlaneWithProxyConfigBottlerocket(t *testing.T) { controlPlaneMachineTemplate := snow.MachineTemplate("snow-test-control-plane-1", g.machineConfigs["test-cp"], nil) got, err := snow.KubeadmControlPlane(g.logger, g.clusterSpec, controlPlaneMachineTemplate) g.Expect(err).To(Succeed()) - want := wantKubeadmControlPlane() + want := wantKubeadmControlPlane("1.21") want.Spec.KubeadmConfigSpec.Format = "bottlerocket" want.Spec.KubeadmConfigSpec.PreKubeadmCommands = []string{} want.Spec.KubeadmConfigSpec.ClusterConfiguration.BottlerocketBootstrap = bootstrap @@ -679,7 +693,7 @@ func TestKubeadmControlPlaneWithBottlerocketAdditionalSettings(t *testing.T) { controlPlaneMachineTemplate := snow.MachineTemplate("snow-test-control-plane-1", g.machineConfigs["test-cp"], nil) got, err := snow.KubeadmControlPlane(g.logger, g.clusterSpec, controlPlaneMachineTemplate) g.Expect(err).To(Succeed()) - want := wantKubeadmControlPlane() + want := wantKubeadmControlPlane("1.21") want.Spec.KubeadmConfigSpec.Format = "bottlerocket" want.Spec.KubeadmConfigSpec.PreKubeadmCommands = []string{} want.Spec.KubeadmConfigSpec.ClusterConfiguration.BottlerocketBootstrap = bootstrap diff --git a/pkg/providers/snow/objects_test.go b/pkg/providers/snow/objects_test.go index 95695d4e4216..4043763ab153 100644 --- a/pkg/providers/snow/objects_test.go +++ b/pkg/providers/snow/objects_test.go @@ -53,7 +53,7 @@ func TestControlPlaneObjects(t *testing.T) { wantMachineTemplateName := "test-cp-2" mt.SetName(wantMachineTemplateName) mt.Spec.Template.Spec.InstanceType = "sbe-c.large" - kcp := wantKubeadmControlPlane() + kcp := wantKubeadmControlPlane("1.21") kcp.Spec.MachineTemplate.InfrastructureRef.Name = wantMachineTemplateName kcp.Spec.KubeadmConfigSpec.JoinConfiguration.NodeRegistration.IgnorePreflightErrors = []string{"DirAvailable--etc-kubernetes-manifests"} @@ -117,7 +117,7 @@ func TestControlPlaneObjectsWithIPPools(t *testing.T) { wantMachineTemplateName := "test-cp-2" mt.SetName(wantMachineTemplateName) mt.Spec.Template.Spec.InstanceType = "sbe-c.large" - kcp := wantKubeadmControlPlane() + kcp := wantKubeadmControlPlane("1.21") kcp.Spec.MachineTemplate.InfrastructureRef.Name = wantMachineTemplateName kcp.Spec.KubeadmConfigSpec.JoinConfiguration.NodeRegistration.IgnorePreflightErrors = []string{"DirAvailable--etc-kubernetes-manifests"} @@ -273,7 +273,7 @@ func TestControlPlaneObjectsOldControlPlaneNotExists(t *testing.T) { mt.SetName("snow-test-control-plane-1") mt.Spec.Template.Spec.InstanceType = "sbe-c.large" - kcp := wantKubeadmControlPlane() + kcp := wantKubeadmControlPlane("1.21") kcp.Spec.KubeadmConfigSpec.JoinConfiguration.NodeRegistration.IgnorePreflightErrors = []string{"DirAvailable--etc-kubernetes-manifests"} got, err := snow.ControlPlaneObjects(g.ctx, g.logger, g.clusterSpec, g.kubeconfigClient) @@ -306,7 +306,7 @@ func TestControlPlaneObjectsOldMachineTemplateNotExists(t *testing.T) { mt.SetName("snow-test-control-plane-1") mt.Spec.Template.Spec.InstanceType = "sbe-c.large" - kcp := wantKubeadmControlPlane() + kcp := wantKubeadmControlPlane("1.21") kcp.Spec.KubeadmConfigSpec.JoinConfiguration.NodeRegistration.IgnorePreflightErrors = []string{"DirAvailable--etc-kubernetes-manifests"} got, err := snow.ControlPlaneObjects(g.ctx, g.logger, g.clusterSpec, g.kubeconfigClient) diff --git a/pkg/providers/snow/snow_test.go b/pkg/providers/snow/snow_test.go index 59b25cf88ecf..11a2a76f4cb2 100644 --- a/pkg/providers/snow/snow_test.go +++ b/pkg/providers/snow/snow_test.go @@ -86,77 +86,149 @@ func givenClusterSpec() *cluster.Spec { s.SnowCredentialsSecret = wantEksaCredentialsSecret() s.SnowMachineConfigs = givenMachineConfigs() s.SnowIPPools = givenIPPools() - s.VersionsBundles["1.21"] = givenVersionsBundle() + s.VersionsBundles["1.21"] = givenVersionsBundle("1.21") + s.VersionsBundles["1.29"] = givenVersionsBundle("1.29") s.ManagementCluster = givenManagementCluster() }) } -func givenVersionsBundle() *cluster.VersionsBundle { - return &cluster.VersionsBundle{ - KubeDistro: &cluster.KubeDistro{ - Kubernetes: cluster.VersionedRepository{ - Repository: "public.ecr.aws/eks-distro/kubernetes", - Tag: "v1.21.5-eks-1-21-9", - }, - CoreDNS: cluster.VersionedRepository{ - Repository: "public.ecr.aws/eks-distro/coredns", - Tag: "v1.8.4-eks-1-21-9", - }, - Etcd: cluster.VersionedRepository{ - Repository: "public.ecr.aws/eks-distro/etcd-io", - Tag: "v3.4.16-eks-1-21-9", - }, - EtcdImage: releasev1alpha1.Image{ - URI: "public.ecr.aws/eks-distro/etcd-io/etcd:0.0.1", +func givenVersionsBundle(kubeVersion v1alpha1.KubernetesVersion) *cluster.VersionsBundle { + switch kubeVersion { + case "1.21": + return &cluster.VersionsBundle{ + KubeDistro: &cluster.KubeDistro{ + Kubernetes: cluster.VersionedRepository{ + Repository: "public.ecr.aws/eks-distro/kubernetes", + Tag: "v1.21.5-eks-1-21-9", + }, + CoreDNS: cluster.VersionedRepository{ + Repository: "public.ecr.aws/eks-distro/coredns", + Tag: "v1.8.4-eks-1-21-9", + }, + Etcd: cluster.VersionedRepository{ + Repository: "public.ecr.aws/eks-distro/etcd-io", + Tag: "v3.4.16-eks-1-21-9", + }, + EtcdImage: releasev1alpha1.Image{ + URI: "public.ecr.aws/eks-distro/etcd-io/etcd:0.0.1", + }, + Pause: releasev1alpha1.Image{ + URI: "public.ecr.aws/eks-distro/kubernetes/pause:0.0.1", + }, + EtcdVersion: "3.4.16", + EtcdURL: "https://distro.eks.amazonaws.com/kubernetes-1-21/releases/4/artifacts/etcd/v3.4.16/etcd-linux-amd64-v3.4.16.tar.gz", }, - Pause: releasev1alpha1.Image{ - URI: "public.ecr.aws/eks-distro/kubernetes/pause:0.0.1", + VersionsBundle: &releasev1alpha1.VersionsBundle{ + KubeVersion: "1.21", + Snow: releasev1alpha1.SnowBundle{ + Version: "v1.0.2", + KubeVip: releasev1alpha1.Image{ + Name: "kube-vip", + OS: "linux", + URI: "public.ecr.aws/l0g8r8j6/kube-vip/kube-vip:v0.3.7-eks-a-v0.0.0-dev-build.1433", + ImageDigest: "sha256:cf324971db7696810effd5c6c95e34b2c115893e1fbcaeb8877355dc74768ef1", + Description: "Container image for kube-vip image", + Arch: []string{"amd64"}, + }, + Manager: releasev1alpha1.Image{ + Name: "cluster-api-snow-controller", + OS: "linux", + URI: "public.ecr.aws/l0g8r8j6/aws/cluster-api-provider-aws-snow/manager:v0.1.4-eks-a-v0.0.0-dev-build.2216", + ImageDigest: "sha256:59da9c726c4816c29d119e77956c6391e2dff451daf36aeb60e5d6425eb88018", + Description: "Container image for cluster-api-snow-controller image", + Arch: []string{"amd64"}, + }, + BottlerocketBootstrapSnow: releasev1alpha1.Image{ + Name: "bottlerocket-bootstrap-snow", + OS: "linux", + URI: "public.ecr.aws/l0g8r8j6/bottlerocket-bootstrap-snow:v1-20-22-eks-a-v0.0.0-dev-build.4984", + ImageDigest: "sha256:59da9c726c4816c29d119e77956c6391e2dff451daf36aeb60e5d6425eb88018", + Description: "Container image for bottlerocket-bootstrap-snow image", + Arch: []string{"amd64"}, + }, + }, + BottleRocketHostContainers: releasev1alpha1.BottlerocketHostContainersBundle{ + Admin: releasev1alpha1.Image{ + URI: "public.ecr.aws/eks-anywhere/bottlerocket-admin:0.0.1", + }, + Control: releasev1alpha1.Image{ + URI: "public.ecr.aws/eks-anywhere/bottlerocket-control:0.0.1", + }, + KubeadmBootstrap: releasev1alpha1.Image{ + URI: "public.ecr.aws/eks-anywhere/bottlerocket-bootstrap:0.0.1", + }, + }, }, - EtcdVersion: "3.4.16", - EtcdURL: "https://distro.eks.amazonaws.com/kubernetes-1-21/releases/4/artifacts/etcd/v3.4.16/etcd-linux-amd64-v3.4.16.tar.gz", - }, - VersionsBundle: &releasev1alpha1.VersionsBundle{ - KubeVersion: "1.21", - Snow: releasev1alpha1.SnowBundle{ - Version: "v1.0.2", - KubeVip: releasev1alpha1.Image{ - Name: "kube-vip", - OS: "linux", - URI: "public.ecr.aws/l0g8r8j6/kube-vip/kube-vip:v0.3.7-eks-a-v0.0.0-dev-build.1433", - ImageDigest: "sha256:cf324971db7696810effd5c6c95e34b2c115893e1fbcaeb8877355dc74768ef1", - Description: "Container image for kube-vip image", - Arch: []string{"amd64"}, + } + case "1.29": + return &cluster.VersionsBundle{ + KubeDistro: &cluster.KubeDistro{ + Kubernetes: cluster.VersionedRepository{ + Repository: "public.ecr.aws/eks-distro/kubernetes", + Tag: "v1.29.0-eks-1-29-3", }, - Manager: releasev1alpha1.Image{ - Name: "cluster-api-snow-controller", - OS: "linux", - URI: "public.ecr.aws/l0g8r8j6/aws/cluster-api-provider-aws-snow/manager:v0.1.4-eks-a-v0.0.0-dev-build.2216", - ImageDigest: "sha256:59da9c726c4816c29d119e77956c6391e2dff451daf36aeb60e5d6425eb88018", - Description: "Container image for cluster-api-snow-controller image", - Arch: []string{"amd64"}, + CoreDNS: cluster.VersionedRepository{ + Repository: "public.ecr.aws/eks-distro/coredns", + Tag: "v1.11.1-eks-1-29-3", }, - BottlerocketBootstrapSnow: releasev1alpha1.Image{ - Name: "bottlerocket-bootstrap-snow", - OS: "linux", - URI: "public.ecr.aws/l0g8r8j6/bottlerocket-bootstrap-snow:v1-20-22-eks-a-v0.0.0-dev-build.4984", - ImageDigest: "sha256:59da9c726c4816c29d119e77956c6391e2dff451daf36aeb60e5d6425eb88018", - Description: "Container image for bottlerocket-bootstrap-snow image", - Arch: []string{"amd64"}, + Etcd: cluster.VersionedRepository{ + Repository: "public.ecr.aws/eks-distro/etcd-io", + Tag: "v3.5.10-eks-1-29-3", }, - }, - BottleRocketHostContainers: releasev1alpha1.BottlerocketHostContainersBundle{ - Admin: releasev1alpha1.Image{ - URI: "public.ecr.aws/eks-anywhere/bottlerocket-admin:0.0.1", + EtcdImage: releasev1alpha1.Image{ + URI: "public.ecr.aws/eks-distro/etcd-io/etcd:v3.5.10-eks-1-29-3", }, - Control: releasev1alpha1.Image{ - URI: "public.ecr.aws/eks-anywhere/bottlerocket-control:0.0.1", + EtcdURL: "https://distro.eks.amazonaws.com/kubernetes-1-29/releases/3/artifacts/etcd/v3.5.10/etcd-linux-amd64-v3.5.10.tar.gz", + EtcdVersion: "3.5.10", + Pause: releasev1alpha1.Image{ + URI: "public.ecr.aws/eks-distro/kubernetes/pause:v1.29.0-eks-1-29-3", }, - KubeadmBootstrap: releasev1alpha1.Image{ - URI: "public.ecr.aws/eks-anywhere/bottlerocket-bootstrap:0.0.1", + }, + VersionsBundle: &releasev1alpha1.VersionsBundle{ + KubeVersion: "1.29", + Snow: releasev1alpha1.SnowBundle{ + Version: "v1.0.2", + KubeVip: releasev1alpha1.Image{ + Name: "kube-vip", + OS: "linux", + URI: "public.ecr.aws/l0g8r8j6/kube-vip/kube-vip:v0.3.7-eks-a-v0.0.0-dev-build.1433", + ImageDigest: "sha256:cf324971db7696810effd5c6c95e34b2c115893e1fbcaeb8877355dc74768ef1", + Description: "Container image for kube-vip image", + Arch: []string{"amd64"}, + }, + Manager: releasev1alpha1.Image{ + Name: "cluster-api-snow-controller", + OS: "linux", + URI: "public.ecr.aws/l0g8r8j6/aws/cluster-api-provider-aws-snow/manager:v0.1.4-eks-a-v0.0.0-dev-build.2216", + ImageDigest: "sha256:59da9c726c4816c29d119e77956c6391e2dff451daf36aeb60e5d6425eb88018", + Description: "Container image for cluster-api-snow-controller image", + Arch: []string{"amd64"}, + }, + BottlerocketBootstrapSnow: releasev1alpha1.Image{ + Name: "bottlerocket-bootstrap-snow", + OS: "linux", + URI: "public.ecr.aws/l0g8r8j6/bottlerocket-bootstrap-snow:v1-20-22-eks-a-v0.0.0-dev-build.4984", + ImageDigest: "sha256:59da9c726c4816c29d119e77956c6391e2dff451daf36aeb60e5d6425eb88018", + Description: "Container image for bottlerocket-bootstrap-snow image", + Arch: []string{"amd64"}, + }, + }, + BottleRocketHostContainers: releasev1alpha1.BottlerocketHostContainersBundle{ + Admin: releasev1alpha1.Image{ + URI: "public.ecr.aws/eks-anywhere/bottlerocket-admin:0.0.1", + }, + Control: releasev1alpha1.Image{ + URI: "public.ecr.aws/eks-anywhere/bottlerocket-control:0.0.1", + }, + KubeadmBootstrap: releasev1alpha1.Image{ + URI: "public.ecr.aws/eks-anywhere/bottlerocket-bootstrap:0.0.1", + }, }, }, - }, + } } + + return nil } func givenManagementComponents() *cluster.ManagementComponents { @@ -738,7 +810,7 @@ func TestGenerateCAPISpecForUpgrade(t *testing.T) { func TestGenerateCAPISpecForUpgradeWorkerVersion(t *testing.T) { tt := newSnowTest(t) - workerVersionsBundle := givenVersionsBundle() + workerVersionsBundle := givenVersionsBundle("1.21") workerVersionsBundle.KubeDistro.Kubernetes.Tag = "v1.20.2-eks-1-20-7" tt.clusterSpec.VersionsBundles["1.20"] = workerVersionsBundle nodeGroups := tt.clusterSpec.Cluster.Spec.WorkerNodeGroupConfigurations diff --git a/pkg/providers/tinkerbell/config/template-cp.yaml b/pkg/providers/tinkerbell/config/template-cp.yaml index b62aaaede58c..4d251acbe005 100644 --- a/pkg/providers/tinkerbell/config/template-cp.yaml +++ b/pkg/providers/tinkerbell/config/template-cp.yaml @@ -395,13 +395,19 @@ spec: - {{ . }} {{- end }} {{- end }} -{{- if and (or .proxyConfig .registryMirrorMap) (ne .format "bottlerocket") }} +{{- $kube_minor_version := (index (splitList "." (trimPrefix "v" .kubernetesVersion)) 1) }} +{{- if and (or .registryMirrorMap .proxyConfig (ge (atoi $kube_minor_version) 29)) (ne .format "bottlerocket") }} preKubeadmCommands: {{- if .registryMirrorMap }} - cat /etc/containerd/config_append.toml >> /etc/containerd/config.toml {{- end}} +{{- if (or .registryMirrorMap .proxyConfig) }} - sudo systemctl daemon-reload - sudo systemctl restart containerd +{{- end}} +{{- if (ge (atoi $kube_minor_version) 29) }} + - "if [ -f /run/kubeadm/kubeadm.yaml ]; then sed -i 's#path: /etc/kubernetes/admin.conf#path: /etc/kubernetes/super-admin.conf#' /etc/kubernetes/manifests/kube-vip.yaml; fi" +{{- end }} {{- end }} users: - name: {{.controlPlaneSshUsername}} diff --git a/pkg/providers/vsphere/config/template-cp.yaml b/pkg/providers/vsphere/config/template-cp.yaml index 414585039e5c..ac62d4464ec1 100644 --- a/pkg/providers/vsphere/config/template-cp.yaml +++ b/pkg/providers/vsphere/config/template-cp.yaml @@ -472,6 +472,10 @@ spec: - echo "127.0.0.1 localhost" >>/etc/hosts - echo "127.0.0.1 {{`{{ ds.meta_data.hostname }}`}}" >>/etc/hosts - echo "{{`{{ ds.meta_data.hostname }}`}}" >/etc/hostname +{{- $kube_minor_version := (index (splitList "." (trimPrefix "v" .kubernetesVersion)) 1) }} +{{- if and (ge (atoi $kube_minor_version) 29) (ne .format "bottlerocket") }} + - "if [ -f /run/kubeadm/kubeadm.yaml ]; then sed -i 's#path: /etc/kubernetes/admin.conf#path: /etc/kubernetes/super-admin.conf#' /etc/kubernetes/manifests/kube-vip.yaml; fi" +{{- end }} useExperimentalRetryJoin: true users: - name: {{.controlPlaneSshUsername}}