diff --git a/projects/kubernetes-sigs/cluster-api/ATTRIBUTION.txt b/projects/kubernetes-sigs/cluster-api/ATTRIBUTION.txt index cb171f8eef..98bd770e4f 100644 --- a/projects/kubernetes-sigs/cluster-api/ATTRIBUTION.txt +++ b/projects/kubernetes-sigs/cluster-api/ATTRIBUTION.txt @@ -1017,7 +1017,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ** github.com/liggitt/tabwriter; version v0.0.0-20181228230101-89fcab3d43de -- https://github.com/liggitt/tabwriter -** golang.org/go; version go1.19.10 -- +** golang.org/go; version go1.19.11 -- https://github.com/golang/go ** golang.org/x/crypto; version v0.3.0 -- diff --git a/projects/kubernetes-sigs/cluster-api/CAPD_ATTRIBUTION.txt b/projects/kubernetes-sigs/cluster-api/CAPD_ATTRIBUTION.txt index 4f22d5964a..a099ceba05 100644 --- a/projects/kubernetes-sigs/cluster-api/CAPD_ATTRIBUTION.txt +++ b/projects/kubernetes-sigs/cluster-api/CAPD_ATTRIBUTION.txt @@ -827,7 +827,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------ -** golang.org/go; version go1.19.10 -- +** golang.org/go; version go1.19.11 -- https://github.com/golang/go ** golang.org/x/net; version v0.8.0 -- diff --git a/projects/kubernetes-sigs/cluster-api/CHECKSUMS b/projects/kubernetes-sigs/cluster-api/CHECKSUMS index ee8db59d7f..716b80aefd 100644 --- a/projects/kubernetes-sigs/cluster-api/CHECKSUMS +++ b/projects/kubernetes-sigs/cluster-api/CHECKSUMS @@ -1,10 +1,10 @@ -2121f9f2d640e80805bac00380be2487047474efed557ae4e7ddad64e3bd5aab _output/bin/cluster-api/linux-amd64/cluster-api-provider-docker-manager -56670cd869d1873ca3dcafda1d86ae99d6a15f87208c77b214577ea5d22b8b80 _output/bin/cluster-api/linux-amd64/clusterctl -7f5dd8b550656192f2d8a09f8f3a29ff2002e37c762d9f3b86e4de5e8fd70999 _output/bin/cluster-api/linux-amd64/kubeadm-bootstrap-manager -e7fea3cfb74edba0e1ff34fff0837a12b68511e763defb1aa0aff41b72b85cc0 _output/bin/cluster-api/linux-amd64/kubeadm-control-plane-manager -5def839a2076f9aaeb93262e8f486c76a2dcdaa80b31b2339b9708b22a824360 _output/bin/cluster-api/linux-amd64/manager -0a925b51d0a6359963032771b2a4ba0f1bb1c1a458a771f73740b2afc233710a _output/bin/cluster-api/linux-arm64/cluster-api-provider-docker-manager -8c124b8b5632fd8531b66d6d57ddbb8e1a3a16c17b071e0fb26565068d7a46af _output/bin/cluster-api/linux-arm64/clusterctl -8c93d5079b878cdc70b59ead338c9abaa88c005eb518589a1f50854e7a0b9772 _output/bin/cluster-api/linux-arm64/kubeadm-bootstrap-manager -190343f30008313cee0d3671a150ba936859da4a3b44fefefbcf5d798cc217f4 _output/bin/cluster-api/linux-arm64/kubeadm-control-plane-manager -0a130163cabc18241f3bd1e0fd3cb9e3e945ca82d55a39e30c8ee714a38df00e _output/bin/cluster-api/linux-arm64/manager \ No newline at end of file +f89356f1591cee618894373ae9ff3f4b14d6d0d0dc959c5ff1dfce81fdadc52e _output/bin/cluster-api/linux-amd64/cluster-api-provider-docker-manager +99d0eb50759b2cc78a81c756737249c6206c1fdb25e5d6aee4ed5daf8f71ee4d _output/bin/cluster-api/linux-amd64/clusterctl +4e7e52e6f1ae4b9a7d25dbc1f88c2d16aeb5eb70b97dca2b127e803033faceb9 _output/bin/cluster-api/linux-amd64/kubeadm-bootstrap-manager +d96d281b17c1b22b47b2186e80b889eee31aac0daee4ecdc3ea9a5d67050e998 _output/bin/cluster-api/linux-amd64/kubeadm-control-plane-manager +5717aad8f239a6f7f13616ae06ede1adfa4cc1cb38a3b904e98c3390e51a1fd6 _output/bin/cluster-api/linux-amd64/manager +9d349a55f52928285787b868d56fa78a592f7a73851b88039357745f173224ce _output/bin/cluster-api/linux-arm64/cluster-api-provider-docker-manager +288beaa4422dd8f0e756d5f5939fc1ec6cd5e373136677e9fe65d366cf3445db _output/bin/cluster-api/linux-arm64/clusterctl +784b355d751dfeb2f391d76b3ac9bc2af79d241867569c4fb86a90b4b6817f76 _output/bin/cluster-api/linux-arm64/kubeadm-bootstrap-manager +f0e6739075ebe64e530b14d0b974fd76b89d3de64e0bef67b151ae45356bdae4 _output/bin/cluster-api/linux-arm64/kubeadm-control-plane-manager +d16f177d9f1c1a8676c43b7a1ef7734e67b48e5ac6223301a1a95ec42b07c819 _output/bin/cluster-api/linux-arm64/manager diff --git a/projects/kubernetes-sigs/cluster-api/patches/0001-Adding-capi-support-for-Bottlerocket.patch b/projects/kubernetes-sigs/cluster-api/patches/0001-Adding-capi-support-for-Bottlerocket.patch index b1127a726f..73578af735 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0001-Adding-capi-support-for-Bottlerocket.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0001-Adding-capi-support-for-Bottlerocket.patch @@ -1,4 +1,4 @@ -From c0d89ec2a34390253ed684c6f375e7c98309db66 Mon Sep 17 00:00:00 2001 +From 9bbc1dca3a74e87ce3f663a1114017733a516964 Mon Sep 17 00:00:00 2001 From: Vignesh Goutham Ganesh Date: Fri, 11 Jun 2021 10:43:09 -0700 Subject: [PATCH 01/34] Adding capi support for Bottlerocket @@ -1846,5 +1846,5 @@ index f96cd8fa6..3588c8779 100644 k8s.io/cli-runtime v0.25.0 // indirect k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0002-Add-unstacked-etcd-support.patch b/projects/kubernetes-sigs/cluster-api/patches/0002-Add-unstacked-etcd-support.patch index ecc3973549..f52ccabf71 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0002-Add-unstacked-etcd-support.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0002-Add-unstacked-etcd-support.patch @@ -1,4 +1,4 @@ -From 2fe4c08c2a74571f00aef74c3cca5b8fb1c50235 Mon Sep 17 00:00:00 2001 +From 56b02a77502d28d11c1189078ebfb2b048b26d1f Mon Sep 17 00:00:00 2001 From: Rajashree Mandaogane Date: Mon, 28 Jun 2021 13:44:50 -0700 Subject: [PATCH 02/34] Add unstacked etcd support @@ -67,7 +67,7 @@ We previously had added this permission, it got dropped while rebasing commits on the new 1.0.1 branch. This commit adds back the permission. --- api/v1alpha3/cluster_types.go | 14 ++ - api/v1alpha3/condition_consts.go | 17 ++- + api/v1alpha3/condition_consts.go | 17 +- api/v1alpha3/machine_types.go | 5 +- api/v1alpha4/cluster_types.go | 14 ++ api/v1beta1/cluster_types.go | 14 ++ @@ -75,23 +75,27 @@ commits on the new 1.0.1 branch. This commit adds back the permission. api/v1beta1/machine_types.go | 3 + .../bottlerocket/controlplane_init.go | 2 - cmd/clusterctl/client/cluster/mover.go | 3 +- - .../crd/bases/cluster.x-k8s.io_clusters.yaml | 144 ++++++++++++++++++ + .../crd/bases/cluster.x-k8s.io_clusters.yaml | 144 ++++++++++++ config/rbac/role.yaml | 15 ++ - controllers/external/util.go | 10 ++ + controllers/external/util.go | 10 + .../v1beta1/kubeadm_control_plane_webhook.go | 1 + - controlplane/kubeadm/config/rbac/role.yaml | 9 ++ - .../internal/controllers/controller.go | 40 +++++ - .../controllers/cluster/cluster_controller.go | 89 ++++++++++- - .../cluster/cluster_controller_phases.go | 108 +++++++++++++ - .../cluster/cluster_controller_test.go | 134 ++++++++++++++++ + controlplane/kubeadm/config/rbac/role.yaml | 9 + + .../internal/controllers/controller.go | 57 +++++ + .../internal/controllers/controller_test.go | 213 +++++++++++++++++- + .../controllers/cluster/cluster_controller.go | 89 +++++++- + .../cluster/cluster_controller_phases.go | 108 +++++++++ + .../cluster/cluster_controller_test.go | 134 +++++++++++ .../machine/machine_controller_noderef.go | 5 + - .../machine/machine_controller_phases.go | 115 ++++++++++++++ - .../controllers/dockermachine_controller.go | 35 +++-- - util/collections/machine_filters.go | 26 ++++ + .../machine/machine_controller_phases.go | 115 ++++++++++ + internal/test/builder/etcd.go | 80 +++++++ + .../controllers/dockermachine_controller.go | 35 +-- + util/annotations/helpers.go | 4 +- + util/collections/machine_filters.go | 26 +++ util/secret/certificates.go | 3 + util/secret/consts.go | 2 + util/util.go | 6 + - 25 files changed, 810 insertions(+), 20 deletions(-) + 28 files changed, 1121 insertions(+), 23 deletions(-) + create mode 100644 internal/test/builder/etcd.go diff --git a/api/v1alpha3/cluster_types.go b/api/v1alpha3/cluster_types.go index 66dd8458a..503de063a 100644 @@ -569,7 +573,7 @@ index ec2334e96..5c7e70401 100644 + - update + - watch diff --git a/controlplane/kubeadm/internal/controllers/controller.go b/controlplane/kubeadm/internal/controllers/controller.go -index b9ca684b8..277cd2e09 100644 +index b9ca684b8..cab1a354d 100644 --- a/controlplane/kubeadm/internal/controllers/controller.go +++ b/controlplane/kubeadm/internal/controllers/controller.go @@ -19,6 +19,9 @@ package controllers @@ -598,7 +602,7 @@ index b9ca684b8..277cd2e09 100644 // KubeadmControlPlaneReconciler reconciles a KubeadmControlPlane object. type KubeadmControlPlaneReconciler struct { -@@ -173,6 +178,32 @@ func (r *KubeadmControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl. +@@ -173,6 +178,45 @@ func (r *KubeadmControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl. return ctrl.Result{Requeue: true}, nil } @@ -608,15 +612,28 @@ index b9ca684b8..277cd2e09 100644 + if err != nil { + return ctrl.Result{}, err + } ++ ++ externalEtcdReady, err := external.IsReady(externalEtcd) ++ if err != nil { ++ return ctrl.Result{}, err ++ } ++ ++ if !externalEtcdReady { ++ log.Info("Managed external etcd is not ready yet, requeueing", "managedExternalEtcd", klog.KObj(externalEtcd)) ++ return ctrl.Result{RequeueAfter: 1 * time.Minute}, nil ++ } ++ + endpoints, found, err := external.GetExternalEtcdEndpoints(externalEtcd) + if err != nil { + return ctrl.Result{}, errors.Wrapf(err, "failed to get endpoint field from %v", externalEtcd.GetName()) + } -+ if !found { -+ log.Info("Etcd endpoints not available") -+ return ctrl.Result{Requeue: true}, nil -+ } + currentEtcdEndpoints := strings.Split(endpoints, ",") ++ ++ if !found || areEndpointsEmpty(currentEtcdEndpoints) { ++ log.Info("Managed external etcd endpoints not available, requeueing") ++ return ctrl.Result{RequeueAfter: 1 * time.Minute}, nil ++ } ++ + sort.Strings(currentEtcdEndpoints) + currentKCPEndpoints := kcp.Spec.KubeadmConfigSpec.ClusterConfiguration.Etcd.External.Endpoints + if !reflect.DeepEqual(currentEtcdEndpoints, currentKCPEndpoints) { @@ -631,7 +648,18 @@ index b9ca684b8..277cd2e09 100644 // Add finalizer first if not exist to avoid the race condition between init and delete if !controllerutil.ContainsFinalizer(kcp, controlplanev1.KubeadmControlPlaneFinalizer) { controllerutil.AddFinalizer(kcp, controlplanev1.KubeadmControlPlaneFinalizer) -@@ -465,6 +496,15 @@ func (r *KubeadmControlPlaneReconciler) reconcileDelete(ctx context.Context, clu +@@ -240,6 +284,10 @@ func (r *KubeadmControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl. + return res, err + } + ++func areEndpointsEmpty(endpoints []string) bool { ++ return len(endpoints) == 0 || len(endpoints) == 1 && endpoints[0] == "" ++} ++ + func patchKubeadmControlPlane(ctx context.Context, patchHelper *patch.Helper, kcp *controlplanev1.KubeadmControlPlane) error { + // Always update the readyCondition by summarizing the state of other conditions. + conditions.SetSummary(kcp, +@@ -465,6 +513,15 @@ func (r *KubeadmControlPlaneReconciler) reconcileDelete(ctx context.Context, clu } ownedMachines := allMachines.Filter(collections.OwnedMachines(kcp)) @@ -647,6 +675,251 @@ index b9ca684b8..277cd2e09 100644 // If no control plane machines remain, remove the finalizer if len(ownedMachines) == 0 { controllerutil.RemoveFinalizer(kcp, controlplanev1.KubeadmControlPlaneFinalizer) +diff --git a/controlplane/kubeadm/internal/controllers/controller_test.go b/controlplane/kubeadm/internal/controllers/controller_test.go +index 05218bb48..4ba548546 100644 +--- a/controlplane/kubeadm/internal/controllers/controller_test.go ++++ b/controlplane/kubeadm/internal/controllers/controller_test.go +@@ -24,6 +24,7 @@ import ( + "crypto/x509/pkix" + "fmt" + "math/big" ++ "strings" + "sync" + "testing" + "time" +@@ -56,6 +57,7 @@ import ( + "sigs.k8s.io/cluster-api/internal/test/builder" + "sigs.k8s.io/cluster-api/internal/util/ssa" + "sigs.k8s.io/cluster-api/util" ++ "sigs.k8s.io/cluster-api/util/annotations" + "sigs.k8s.io/cluster-api/util/certs" + "sigs.k8s.io/cluster-api/util/collections" + "sigs.k8s.io/cluster-api/util/conditions" +@@ -82,7 +84,8 @@ func TestClusterToKubeadmControlPlane(t *testing.T) { + { + NamespacedName: client.ObjectKey{ + Namespace: cluster.Spec.ControlPlaneRef.Namespace, +- Name: cluster.Spec.ControlPlaneRef.Name}, ++ Name: cluster.Spec.ControlPlaneRef.Name, ++ }, + }, + } + +@@ -2160,6 +2163,214 @@ func TestKubeadmControlPlaneReconciler_reconcileDelete(t *testing.T) { + }) + } + ++func TestKubeadmControlPlaneReconciler_updateManagedExternalEtcdEndpoints(t *testing.T) { ++ setup := func() (*clusterv1.Cluster, *controlplanev1.KubeadmControlPlane, *unstructured.Unstructured) { ++ ns := "my-ns" ++ endpoints := []string{"1.1.1.1", "2.2.2.2", "0.0.0.0"} ++ managedEtcd := builder.Etcd(ns, "test-7-my-etcd").Build() ++ if err := unstructured.SetNestedField(managedEtcd.Object, true, "status", "ready"); err != nil { ++ t.Fatal(err) ++ } ++ if err := unstructured.SetNestedField(managedEtcd.Object, strings.Join(endpoints, ","), "status", "endpoints"); err != nil { ++ t.Fatal(err) ++ } ++ cluster, kcp, _ := createClusterWithControlPlane(ns) ++ cluster.Spec.ManagedExternalEtcdRef = external.GetObjectReference(managedEtcd) ++ kcp.Spec.KubeadmConfigSpec.ClusterConfiguration = &bootstrapv1.ClusterConfiguration{ ++ Etcd: bootstrapv1.Etcd{External: &bootstrapv1.ExternalEtcd{}}, ++ } ++ ++ return cluster, kcp, managedEtcd ++ } ++ t.Run("should update the endpoints in the kcp", func(t *testing.T) { ++ g := NewWithT(t) ++ cluster, kcp, managedEtcd := setup() ++ conditions.MarkFalse(kcp, controlplanev1.ExternalEtcdEndpointsAvailable, "", "", "") ++ ++ fClient := newFakeClient( ++ builder.GenericEtcdCRD.DeepCopy(), ++ managedEtcd.DeepCopy(), ++ cluster.DeepCopy(), ++ kcp.DeepCopy(), ++ ) ++ ++ r := &KubeadmControlPlaneReconciler{ ++ Client: fClient, ++ managementCluster: &fakeManagementCluster{ ++ Management: &internal.Management{Client: fClient}, ++ Workload: fakeWorkloadCluster{}, ++ }, ++ recorder: record.NewFakeRecorder(32), ++ } ++ ++ result, err := r.Reconcile( ++ ctx, ++ ctrl.Request{client.ObjectKeyFromObject(kcp)}, ++ ) ++ g.Expect(result).To(Equal(ctrl.Result{})) ++ g.Expect(err).NotTo(HaveOccurred()) ++ g.Eventually(func(g Gomega) { ++ cp := &controlplanev1.KubeadmControlPlane{} ++ g.Expect(fClient.Get(ctx, client.ObjectKeyFromObject(kcp), cp)).To(Succeed()) ++ g.Expect( ++ cp.Spec.KubeadmConfigSpec.ClusterConfiguration.Etcd.External.Endpoints, ++ ).To(Equal([]string{"0.0.0.0", "1.1.1.1", "2.2.2.2"})) ++ conditions.IsTrue(kcp, controlplanev1.ExternalEtcdEndpointsAvailable) ++ }, 5*time.Second).Should(Succeed()) ++ }) ++ ++ t.Run("should requeue and not update kcp when endpoints in external etcd are not set", func(t *testing.T) { ++ g := NewWithT(t) ++ cluster, kcp, managedEtcd := setup() ++ unstructured.RemoveNestedField(managedEtcd.Object, "status", "endpoints") ++ kcp.Spec.KubeadmConfigSpec.ClusterConfiguration.Etcd.External.Endpoints = []string{"0.0.0.0", "1.1.1.1", "3.3.3.3"} ++ ++ fClient := newFakeClient( ++ builder.GenericEtcdCRD.DeepCopy(), ++ managedEtcd.DeepCopy(), ++ cluster.DeepCopy(), ++ kcp.DeepCopy(), ++ ) ++ ++ r := &KubeadmControlPlaneReconciler{ ++ Client: fClient, ++ managementCluster: &fakeManagementCluster{ ++ Management: &internal.Management{Client: fClient}, ++ Workload: fakeWorkloadCluster{}, ++ }, ++ recorder: record.NewFakeRecorder(32), ++ } ++ ++ result, err := r.Reconcile( ++ ctx, ++ ctrl.Request{client.ObjectKeyFromObject(kcp)}, ++ ) ++ g.Expect(result).To(Equal(ctrl.Result{RequeueAfter: 1 * time.Minute})) ++ g.Expect(err).NotTo(HaveOccurred()) ++ g.Eventually(func(g Gomega) { ++ cp := &controlplanev1.KubeadmControlPlane{} ++ g.Expect(fClient.Get(ctx, client.ObjectKeyFromObject(kcp), cp)).To(Succeed()) ++ g.Expect( ++ cp.Spec.KubeadmConfigSpec.ClusterConfiguration.Etcd.External.Endpoints, ++ ).To(Equal([]string{"0.0.0.0", "1.1.1.1", "3.3.3.3"})) ++ }, 5*time.Second).Should(Succeed()) ++ }) ++ ++ t.Run("should requeue and not update kcp when endpoints in external etcd are empty", func(t *testing.T) { ++ g := NewWithT(t) ++ cluster, kcp, managedEtcd := setup() ++ g.Expect(unstructured.SetNestedField(managedEtcd.Object, "", "status", "endpoints")).To(Succeed()) ++ kcp.Spec.KubeadmConfigSpec.ClusterConfiguration.Etcd.External.Endpoints = []string{"0.0.0.0", "1.1.1.1", "3.3.3.3"} ++ ++ fClient := newFakeClient( ++ builder.GenericEtcdCRD.DeepCopy(), ++ managedEtcd.DeepCopy(), ++ cluster.DeepCopy(), ++ kcp.DeepCopy(), ++ ) ++ ++ r := &KubeadmControlPlaneReconciler{ ++ Client: fClient, ++ managementCluster: &fakeManagementCluster{ ++ Management: &internal.Management{Client: fClient}, ++ Workload: fakeWorkloadCluster{}, ++ }, ++ recorder: record.NewFakeRecorder(32), ++ } ++ ++ result, err := r.Reconcile( ++ ctx, ++ ctrl.Request{client.ObjectKeyFromObject(kcp)}, ++ ) ++ g.Expect(result).To(Equal(ctrl.Result{RequeueAfter: 1 * time.Minute})) ++ g.Expect(err).NotTo(HaveOccurred()) ++ g.Eventually(func(g Gomega) { ++ cp := &controlplanev1.KubeadmControlPlane{} ++ g.Expect(fClient.Get(ctx, client.ObjectKeyFromObject(kcp), cp)).To(Succeed()) ++ g.Expect( ++ cp.Spec.KubeadmConfigSpec.ClusterConfiguration.Etcd.External.Endpoints, ++ ).To(Equal([]string{"0.0.0.0", "1.1.1.1", "3.3.3.3"})) ++ }, 5*time.Second).Should(Succeed()) ++ }) ++ ++ t.Run("should requeue and not update kcp when endpoints in external etcd is not ready", func(t *testing.T) { ++ g := NewWithT(t) ++ cluster, kcp, managedEtcd := setup() ++ g.Expect(unstructured.SetNestedField(managedEtcd.Object, "0.0.0.0", "status", "endpoints")).To(Succeed()) ++ g.Expect(unstructured.SetNestedField(managedEtcd.Object, false, "status", "ready")).To(Succeed()) ++ kcp.Spec.KubeadmConfigSpec.ClusterConfiguration.Etcd.External.Endpoints = []string{"0.0.0.0", "1.1.1.1", "3.3.3.3"} ++ ++ fClient := newFakeClient( ++ builder.GenericEtcdCRD.DeepCopy(), ++ managedEtcd.DeepCopy(), ++ cluster.DeepCopy(), ++ kcp.DeepCopy(), ++ ) ++ ++ r := &KubeadmControlPlaneReconciler{ ++ Client: fClient, ++ managementCluster: &fakeManagementCluster{ ++ Management: &internal.Management{Client: fClient}, ++ Workload: fakeWorkloadCluster{}, ++ }, ++ recorder: record.NewFakeRecorder(32), ++ } ++ ++ result, err := r.Reconcile( ++ ctx, ++ ctrl.Request{client.ObjectKeyFromObject(kcp)}, ++ ) ++ g.Expect(result).To(Equal(ctrl.Result{RequeueAfter: 1 * time.Minute})) ++ g.Expect(err).NotTo(HaveOccurred()) ++ g.Eventually(func(g Gomega) { ++ cp := &controlplanev1.KubeadmControlPlane{} ++ g.Expect(fClient.Get(ctx, client.ObjectKeyFromObject(kcp), cp)).To(Succeed()) ++ g.Expect( ++ cp.Spec.KubeadmConfigSpec.ClusterConfiguration.Etcd.External.Endpoints, ++ ).To(Equal([]string{"0.0.0.0", "1.1.1.1", "3.3.3.3"})) ++ }, 5*time.Second).Should(Succeed()) ++ }) ++ ++ t.Run("should requeue and not update kcp when etcd is ongoing an upgrade in external etcd is going through an upgrade", func(t *testing.T) { ++ g := NewWithT(t) ++ cluster, kcp, managedEtcd := setup() ++ g.Expect(unstructured.SetNestedField(managedEtcd.Object, "0.0.0.0", "status", "endpoints")).To(Succeed()) ++ annotations.AddAnnotations(managedEtcd, map[string]string{"etcdcluster.cluster.x-k8s.io/upgrading": "true"}) ++ kcp.Spec.KubeadmConfigSpec.ClusterConfiguration.Etcd.External.Endpoints = []string{"0.0.0.0", "1.1.1.1", "3.3.3.3"} ++ ++ fClient := newFakeClient( ++ builder.GenericEtcdCRD.DeepCopy(), ++ managedEtcd.DeepCopy(), ++ cluster.DeepCopy(), ++ kcp.DeepCopy(), ++ ) ++ ++ r := &KubeadmControlPlaneReconciler{ ++ Client: fClient, ++ managementCluster: &fakeManagementCluster{ ++ Management: &internal.Management{Client: fClient}, ++ Workload: fakeWorkloadCluster{}, ++ }, ++ recorder: record.NewFakeRecorder(32), ++ } ++ ++ result, err := r.Reconcile( ++ ctx, ++ ctrl.Request{client.ObjectKeyFromObject(kcp)}, ++ ) ++ g.Expect(result).To(Equal(ctrl.Result{RequeueAfter: 1 * time.Minute})) ++ g.Expect(err).NotTo(HaveOccurred()) ++ g.Eventually(func(g Gomega) { ++ cp := &controlplanev1.KubeadmControlPlane{} ++ g.Expect(fClient.Get(ctx, client.ObjectKeyFromObject(kcp), cp)).To(Succeed()) ++ g.Expect( ++ cp.Spec.KubeadmConfigSpec.ClusterConfiguration.Etcd.External.Endpoints, ++ ).To(Equal([]string{"0.0.0.0", "1.1.1.1", "3.3.3.3"})) ++ conditions.IsFalse(cp, controlplanev1.ExternalEtcdEndpointsAvailable) ++ }, 5*time.Second).Should(Succeed()) ++ }) ++} ++ + // test utils. + + func newFakeClient(initObjs ...client.Object) client.Client { diff --git a/internal/controllers/cluster/cluster_controller.go b/internal/controllers/cluster/cluster_controller.go index ae6127537..6e80c6922 100644 --- a/internal/controllers/cluster/cluster_controller.go @@ -1276,6 +1549,92 @@ index 83c493afc..03806a1b7 100644 // Get and set the failure domain from the infrastructure provider. var failureDomain string err = util.UnstructuredUnmarshalField(infraConfig, &failureDomain, "spec", "failureDomain") +diff --git a/internal/test/builder/etcd.go b/internal/test/builder/etcd.go +new file mode 100644 +index 000000000..096be828b +--- /dev/null ++++ b/internal/test/builder/etcd.go +@@ -0,0 +1,80 @@ ++/* ++Copyright 2023 The Kubernetes Authors. ++ ++Licensed under the Apache License, Version 2.0 (the "License"); ++you may not use this file except in compliance with the License. ++You may obtain a copy of the License at ++ ++ http://www.apache.org/licenses/LICENSE-2.0 ++ ++Unless required by applicable law or agreed to in writing, software ++distributed under the License is distributed on an "AS IS" BASIS, ++WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++See the License for the specific language governing permissions and ++limitations under the License. ++*/ ++ ++package builder ++ ++import ( ++ apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" ++ "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" ++ "k8s.io/apimachinery/pkg/runtime/schema" ++) ++ ++var ( ++ // EtcdGroupVersion is group version used for control plane objects. ++ EtcdGroupVersion = schema.GroupVersion{Group: "etcd.cluster.x-k8s.io", Version: "v1beta1"} ++ ++ // GenericEtcdKind is the Kind for the GenericEtcd. ++ GenericEtcdKind = "GenericEtcd" ++ // GenericEtcdCRD is a generic control plane CRD. ++ GenericEtcdCRD = testEtcdCRD(EtcdGroupVersion.WithKind(GenericEtcdKind)) ++) ++ ++func testEtcdCRD(gvk schema.GroupVersionKind) *apiextensionsv1.CustomResourceDefinition { ++ return generateCRD(gvk, map[string]apiextensionsv1.JSONSchemaProps{ ++ "metadata": { ++ // NOTE: in CRD there is only a partial definition of metadata schema. ++ // Ref https://github.com/kubernetes-sigs/controller-tools/blob/59485af1c1f6a664655dad49543c474bb4a0d2a2/pkg/crd/gen.go#L185 ++ Type: "object", ++ }, ++ "spec": etcdSpecSchema, ++ "status": { ++ Type: "object", ++ Properties: map[string]apiextensionsv1.JSONSchemaProps{ ++ // mandatory fields from the Cluster API contract ++ "ready": {Type: "boolean"}, ++ "initialized": {Type: "boolean"}, ++ "endpoints": {Type: "string"}, ++ }, ++ }, ++ }) ++} ++ ++var etcdSpecSchema = apiextensionsv1.JSONSchemaProps{ ++ Type: "object", ++ Properties: map[string]apiextensionsv1.JSONSchemaProps{}, ++} ++ ++// EtcdPlaneBuilder holds the variables and objects needed to build a generic object for cluster.spec.ManagedExternalEtcdRef. ++type EtcdPlaneBuilder struct { ++ obj *unstructured.Unstructured ++} ++ ++// Etcd returns a EtcdBuilder with the given name and Namespace. ++func Etcd(namespace, name string) *EtcdPlaneBuilder { ++ obj := &unstructured.Unstructured{} ++ obj.SetAPIVersion(EtcdGroupVersion.String()) ++ obj.SetKind(GenericEtcdKind) ++ obj.SetNamespace(namespace) ++ obj.SetName(name) ++ return &EtcdPlaneBuilder{ ++ obj: obj, ++ } ++} ++ ++// Build generates an Unstructured object from the information passed to the EtcdPlaneBuilder. ++func (c *EtcdPlaneBuilder) Build() *unstructured.Unstructured { ++ return c.obj ++} diff --git a/test/infrastructure/docker/internal/controllers/dockermachine_controller.go b/test/infrastructure/docker/internal/controllers/dockermachine_controller.go index 58b426e51..9beedc5af 100644 --- a/test/infrastructure/docker/internal/controllers/dockermachine_controller.go @@ -1330,6 +1689,28 @@ index 58b426e51..9beedc5af 100644 + _, ok := machine.Labels[clusterv1.MachineEtcdClusterLabelName] + return ok +} +diff --git a/util/annotations/helpers.go b/util/annotations/helpers.go +index 0ec9ef938..8118362be 100644 +--- a/util/annotations/helpers.go ++++ b/util/annotations/helpers.go +@@ -70,8 +70,7 @@ func AddAnnotations(o metav1.Object, desired map[string]string) bool { + } + annotations := o.GetAnnotations() + if annotations == nil { +- annotations = make(map[string]string) +- o.SetAnnotations(annotations) ++ annotations = make(map[string]string) + } + hasChanged := false + for k, v := range desired { +@@ -80,6 +79,7 @@ func AddAnnotations(o metav1.Object, desired map[string]string) bool { + hasChanged = true + } + } ++ o.SetAnnotations(annotations) + return hasChanged + } + diff --git a/util/collections/machine_filters.go b/util/collections/machine_filters.go index d85661012..009071cd8 100644 --- a/util/collections/machine_filters.go @@ -1419,5 +1800,5 @@ index e6737ab7a..00da78f90 100644 func GetClusterFromMetadata(ctx context.Context, c client.Client, obj metav1.ObjectMeta) (*clusterv1.Cluster, error) { if obj.Labels[clusterv1.ClusterNameLabel] == "" { -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0003-Unstacked-etcd-and-controlplane-upgrade.patch b/projects/kubernetes-sigs/cluster-api/patches/0003-Unstacked-etcd-and-controlplane-upgrade.patch index 330f1ac4be..db6cd047e0 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0003-Unstacked-etcd-and-controlplane-upgrade.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0003-Unstacked-etcd-and-controlplane-upgrade.patch @@ -1,4 +1,4 @@ -From 849aa74da904a28b6778b06736e7eee0b9216475 Mon Sep 17 00:00:00 2001 +From ba5fe9dd06b4d25fa3327eb3b3cd13230a15214c Mon Sep 17 00:00:00 2001 From: Rajashree Mandaogane Date: Fri, 6 Aug 2021 17:16:39 -0700 Subject: [PATCH 03/34] Unstacked etcd and controlplane upgrade @@ -152,10 +152,10 @@ index e9870d34c..adc1b2a0a 100644 const ( diff --git a/controlplane/kubeadm/internal/controllers/controller.go b/controlplane/kubeadm/internal/controllers/controller.go -index 277cd2e09..0ebace482 100644 +index cab1a354d..9fb1e9603 100644 --- a/controlplane/kubeadm/internal/controllers/controller.go +++ b/controlplane/kubeadm/internal/controllers/controller.go -@@ -196,12 +196,35 @@ func (r *KubeadmControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl. +@@ -209,12 +209,35 @@ func (r *KubeadmControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl. sort.Strings(currentEtcdEndpoints) currentKCPEndpoints := kcp.Spec.KubeadmConfigSpec.ClusterConfiguration.Etcd.External.Endpoints if !reflect.DeepEqual(currentEtcdEndpoints, currentKCPEndpoints) { @@ -191,7 +191,7 @@ index 277cd2e09..0ebace482 100644 } // Add finalizer first if not exist to avoid the race condition between init and delete -@@ -414,6 +437,25 @@ func (r *KubeadmControlPlaneReconciler) reconcile(ctx context.Context, cluster * +@@ -431,6 +454,25 @@ func (r *KubeadmControlPlaneReconciler) reconcile(ctx context.Context, cluster * // NOTE: we are checking the condition already exists in order to avoid to set this condition at the first // reconciliation/before a rolling upgrade actually starts. if conditions.Has(controlPlane.KCP, controlplanev1.MachinesSpecUpToDateCondition) { @@ -295,5 +295,5 @@ index 9572a8ebd..7f2a32379 100644 } -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0004-Patch-config-path-in-kubevip-manifest-for-kubeadm-co.patch b/projects/kubernetes-sigs/cluster-api/patches/0004-Patch-config-path-in-kubevip-manifest-for-kubeadm-co.patch index d45d306722..f91691e357 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0004-Patch-config-path-in-kubevip-manifest-for-kubeadm-co.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0004-Patch-config-path-in-kubevip-manifest-for-kubeadm-co.patch @@ -1,4 +1,4 @@ -From 92d421ea3788679eb0fc877d3ca1b2c95341fcd1 Mon Sep 17 00:00:00 2001 +From 86ad1935e3c6a65c86f6f419911efded91182705 Mon Sep 17 00:00:00 2001 From: Guillermo Gaston Date: Thu, 19 Aug 2021 21:52:52 +0000 Subject: [PATCH 04/34] Patch config path in kubevip manifest for kubeadm @@ -27,5 +27,5 @@ index b93e1164b..aecbda8f4 100644 if err != nil { return nil, errors.Wrapf(err, "failed to generate user data for machine joining control plane") -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0005-Make-pause-and-bottlerocket-bootstrap-images-updatab.patch b/projects/kubernetes-sigs/cluster-api/patches/0005-Make-pause-and-bottlerocket-bootstrap-images-updatab.patch index e9e5bbaab4..76af98a823 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0005-Make-pause-and-bottlerocket-bootstrap-images-updatab.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0005-Make-pause-and-bottlerocket-bootstrap-images-updatab.patch @@ -1,4 +1,4 @@ -From 495362411dba1feef06cb85529549ee5d7381684 Mon Sep 17 00:00:00 2001 +From df8b2037b45148d22c07c42ea359ed258a79148d Mon Sep 17 00:00:00 2001 From: Guillermo Gaston Date: Tue, 31 Aug 2021 15:56:28 +0000 Subject: [PATCH 05/34] Make pause and bottlerocket bootstrap images updatable @@ -95,5 +95,5 @@ index 6ae774051..86c02c2e5 100644 before := &KubeadmControlPlane{ ObjectMeta: metav1.ObjectMeta{ -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0006-add-support-for-registry-mirror-for-bottlerocket.patch b/projects/kubernetes-sigs/cluster-api/patches/0006-add-support-for-registry-mirror-for-bottlerocket.patch index bf23567a45..6efc0a3b31 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0006-add-support-for-registry-mirror-for-bottlerocket.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0006-add-support-for-registry-mirror-for-bottlerocket.patch @@ -1,4 +1,4 @@ -From 4be5d1d84fa1c09cdfd0d0c2298f33639660a4b4 Mon Sep 17 00:00:00 2001 +From dce8408b79a453787219a0653cfbb6b68070146f Mon Sep 17 00:00:00 2001 From: Abhinav Pandey Date: Tue, 21 Sep 2021 08:57:56 -0700 Subject: [PATCH 06/34] add support for registry mirror for bottlerocket @@ -1573,5 +1573,5 @@ index 5a1623e9f..5410d4145 100644 description: SkipPhases is a list of phases to skip during command execution. The list of phases can -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0007-Fix-proxy-template-for-bottlerocket-bootstrap.patch b/projects/kubernetes-sigs/cluster-api/patches/0007-Fix-proxy-template-for-bottlerocket-bootstrap.patch index d0eb52827a..5d92a0cc34 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0007-Fix-proxy-template-for-bottlerocket-bootstrap.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0007-Fix-proxy-template-for-bottlerocket-bootstrap.patch @@ -1,4 +1,4 @@ -From 03ff70b8f2ff2a2ff5c9904962f5650170c7d65f Mon Sep 17 00:00:00 2001 +From 172d51906704352911a99f6069c7bf37bd982e21 Mon Sep 17 00:00:00 2001 From: Rajashree Mandaogane Date: Thu, 30 Sep 2021 14:04:36 -0700 Subject: [PATCH 07/34] Fix proxy template for bottlerocket bootstrap @@ -67,5 +67,5 @@ index f127ec4f1..9e4f8d4a5 100644 bottlerocketInput.RegistryMirrorCACert = base64.StdEncoding.EncodeToString([]byte(config.RegistryMirrorConfiguration.CACert)) } -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0008-Update-core-conversion-spoke-versions.patch b/projects/kubernetes-sigs/cluster-api/patches/0008-Update-core-conversion-spoke-versions.patch index f2b7bb0d75..4505ee0d1b 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0008-Update-core-conversion-spoke-versions.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0008-Update-core-conversion-spoke-versions.patch @@ -1,4 +1,4 @@ -From c9a3b7612f28a88511db92cccdcdb306397e07ad Mon Sep 17 00:00:00 2001 +From c832ddc6d2b7110e8bfa2fe5d48ff49f35e2d25d Mon Sep 17 00:00:00 2001 From: Rajashree Mandaogane Date: Sun, 21 Nov 2021 01:16:11 -0800 Subject: [PATCH 08/34] Update core conversion spoke versions @@ -116,5 +116,5 @@ index 1f0c12a79..0abe06592 100644 } -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0009-Add-bottlerocket-changes-to-capbk-v1alpha4-api.patch b/projects/kubernetes-sigs/cluster-api/patches/0009-Add-bottlerocket-changes-to-capbk-v1alpha4-api.patch index 27fbceca7b..2cb1394259 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0009-Add-bottlerocket-changes-to-capbk-v1alpha4-api.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0009-Add-bottlerocket-changes-to-capbk-v1alpha4-api.patch @@ -1,4 +1,4 @@ -From 4f814782f004e84793f44b9dff84121abd44c57f Mon Sep 17 00:00:00 2001 +From 1848efc8e3d43bccf0a271a97bc0af50c01c9176 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 @@ -1113,5 +1113,5 @@ index 5410d4145..c96b0409c 100644 mounts: description: Mounts specifies a list of mount points to -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0010-Update-capbk-converions-spoke-version.patch b/projects/kubernetes-sigs/cluster-api/patches/0010-Update-capbk-converions-spoke-version.patch index 837ebf1c4d..e4441767af 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0010-Update-capbk-converions-spoke-version.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0010-Update-capbk-converions-spoke-version.patch @@ -1,4 +1,4 @@ -From 775ddc4e4c581624fd5d4ebfccda55b4d789cb61 Mon Sep 17 00:00:00 2001 +From 09696135c7d82bbed4f8476ba8f1f8e2725d0abf Mon Sep 17 00:00:00 2001 From: Rajashree Mandaogane Date: Sun, 21 Nov 2021 21:00:31 -0800 Subject: [PATCH 10/34] Update capbk converions spoke version @@ -938,5 +938,5 @@ index d849616cb..9b0c13356 100644 + return autoConvert_v1beta1_RegistryMirrorConfiguration_To_upstreamv1beta3_RegistryMirrorConfiguration(in, out, s) +} -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0011-Add-status.version-to-list-of-fields-to-ignore-for-u.patch b/projects/kubernetes-sigs/cluster-api/patches/0011-Add-status.version-to-list-of-fields-to-ignore-for-u.patch index 355c8e684e..c073203143 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0011-Add-status.version-to-list-of-fields-to-ignore-for-u.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0011-Add-status.version-to-list-of-fields-to-ignore-for-u.patch @@ -1,4 +1,4 @@ -From d373291a69930725c22d6a46a0c65af412b2030d Mon Sep 17 00:00:00 2001 +From 8572d3e63490a44ed5d3f2e0c62dcc4486e2fc7a Mon Sep 17 00:00:00 2001 From: Vivek Koppuru Date: Wed, 12 Jan 2022 19:04:15 -0800 Subject: [PATCH 11/34] Add status.version to list of fields to ignore for @@ -29,5 +29,5 @@ index 263bda967..1d0d4abfd 100644 allErrs := validateKubeadmControlPlaneSpec(in.Spec, in.Namespace, field.NewPath("spec")) -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0012-Add-node-labels-support-for-bottlerocket.patch b/projects/kubernetes-sigs/cluster-api/patches/0012-Add-node-labels-support-for-bottlerocket.patch index 263ea72725..d67d565a6f 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0012-Add-node-labels-support-for-bottlerocket.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0012-Add-node-labels-support-for-bottlerocket.patch @@ -1,4 +1,4 @@ -From 43bc7ad89d92e9834e67d62dd01fcf0dd657154a Mon Sep 17 00:00:00 2001 +From e7342d73e45831b09d7b322d4d88ba1286ddc9e7 Mon Sep 17 00:00:00 2001 From: Vivek Koppuru Date: Mon, 24 Jan 2022 00:46:44 -0800 Subject: [PATCH 12/34] Add node labels support for bottlerocket @@ -139,5 +139,5 @@ index b1fb19751..8a8c04c92 100644 if err != nil { scope.Error(err, "Failed to generate cloud init for bottlerocket bootstrap control plane") -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0013-Support-worker-node-taints.patch b/projects/kubernetes-sigs/cluster-api/patches/0013-Support-worker-node-taints.patch index 4ab692c3ab..be5bfdc6fb 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0013-Support-worker-node-taints.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0013-Support-worker-node-taints.patch @@ -1,4 +1,4 @@ -From f3b44f5fe0276fb4d11c0530ae67b53e343fd615 Mon Sep 17 00:00:00 2001 +From aabc437f71a47371124a58540c6c511952d75227 Mon Sep 17 00:00:00 2001 From: Daniel Budris Date: Fri, 17 Dec 2021 13:38:39 -0800 Subject: [PATCH 13/34] Support worker node taints @@ -151,5 +151,5 @@ index 8a8c04c92..4b08e24c8 100644 if err != nil { scope.Error(err, "Failed to create a worker bottlerocket join configuration") -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0014-support-bottle-rocket-control-plane-taints.patch b/projects/kubernetes-sigs/cluster-api/patches/0014-support-bottle-rocket-control-plane-taints.patch index b8f4b5e331..8984f9afc5 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0014-support-bottle-rocket-control-plane-taints.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0014-support-bottle-rocket-control-plane-taints.patch @@ -1,4 +1,4 @@ -From 80cfea83d2aada40e9b077ea059695236f60f05b Mon Sep 17 00:00:00 2001 +From e5e733fa20e57fb4439d1ef530b3935b412c4d15 Mon Sep 17 00:00:00 2001 From: danbudris Date: Fri, 18 Feb 2022 09:24:32 -0500 Subject: [PATCH 14/34] support bottle rocket control plane taints @@ -32,5 +32,5 @@ index 4b08e24c8..085ff3460 100644 if err != nil { scope.Error(err, "Failed to generate cloud init for bottlerocket bootstrap control plane") -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0015-Support-configuring-bottlerocket-control-container-u.patch b/projects/kubernetes-sigs/cluster-api/patches/0015-Support-configuring-bottlerocket-control-container-u.patch index cdb03fb9ee..3c7f7a1517 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0015-Support-configuring-bottlerocket-control-container-u.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0015-Support-configuring-bottlerocket-control-container-u.patch @@ -1,4 +1,4 @@ -From 5dd32522f412fcc524ea2d6c451dae46e639c668 Mon Sep 17 00:00:00 2001 +From a06e828bae279ed07c82da47c4c3a7d074603a9b Mon Sep 17 00:00:00 2001 From: Michael Chu Date: Mon, 28 Feb 2022 09:51:25 -0800 Subject: [PATCH 15/34] Support configuring bottlerocket control container uri @@ -1963,5 +1963,5 @@ index 63bbea586..0fede6ce6 100644 extraArgs: bar: baz -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0016-Change-format-for-storing-etcd-machine-address.patch b/projects/kubernetes-sigs/cluster-api/patches/0016-Change-format-for-storing-etcd-machine-address.patch index 984b7ed742..ba242a2886 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0016-Change-format-for-storing-etcd-machine-address.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0016-Change-format-for-storing-etcd-machine-address.patch @@ -1,4 +1,4 @@ -From 57d97e27b69f2b8a76ac25d586b79b8a33399013 Mon Sep 17 00:00:00 2001 +From a61a6c78af776a1a4c37e022d7710fc80dfe0679 Mon Sep 17 00:00:00 2001 From: Rajashree Mandaogane Date: Thu, 3 Mar 2022 15:01:35 -0800 Subject: [PATCH 16/34] Change format for storing etcd machine address @@ -39,5 +39,5 @@ index 03806a1b7..4181ca366 100644 Type: clusterv1.ClusterSecretType, } -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0017-Parse-provider-id-from-kubelet-extra-args.patch b/projects/kubernetes-sigs/cluster-api/patches/0017-Parse-provider-id-from-kubelet-extra-args.patch index 5fa8394058..f36a370e38 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0017-Parse-provider-id-from-kubelet-extra-args.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0017-Parse-provider-id-from-kubelet-extra-args.patch @@ -1,4 +1,4 @@ -From 17d0638ab508ff679b0a3472e64936d432522301 Mon Sep 17 00:00:00 2001 +From d296b944750dcb151a92029b272017e8ede466f0 Mon Sep 17 00:00:00 2001 From: Vignesh Goutham Ganesh Date: Wed, 8 Jun 2022 10:27:26 -0700 Subject: [PATCH 17/34] Parse provider-id from kubelet extra args @@ -44,5 +44,5 @@ index e635308ea..3a760d51a 100644 if config.BottlerocketControl.ImageRepository != "" && config.BottlerocketControl.ImageTag != "" { bottlerocketInput.ControlContainerSource = fmt.Sprintf("%s:%s", config.BottlerocketControl.ImageRepository, config.BottlerocketControl.ImageTag) -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0018-Add-bottlerocket-control-image-on-nodes-joining-a-ne.patch b/projects/kubernetes-sigs/cluster-api/patches/0018-Add-bottlerocket-control-image-on-nodes-joining-a-ne.patch index 8b0993438d..1472da39b1 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0018-Add-bottlerocket-control-image-on-nodes-joining-a-ne.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0018-Add-bottlerocket-control-image-on-nodes-joining-a-ne.patch @@ -1,4 +1,4 @@ -From 3a9ee48150a557205f355b169f0f87cf5b58c4ef Mon Sep 17 00:00:00 2001 +From d76ed134f879c167b326bf6ae3ba099c6caac815 Mon Sep 17 00:00:00 2001 From: Victor Pineda Date: Sun, 19 Jun 2022 10:39:50 -0700 Subject: [PATCH 18/34] Add bottlerocket control image on nodes joining a new @@ -21,5 +21,5 @@ index bc5561a56..2d536dd33 100644 if scope.Config.Spec.JoinConfiguration.Proxy.HTTPSProxy != "" { bottlerocketConfig.ProxyConfiguration = scope.Config.Spec.JoinConfiguration.Proxy -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0019-Add-feature-to-specifiy-additional-host-containers-i.patch b/projects/kubernetes-sigs/cluster-api/patches/0019-Add-feature-to-specifiy-additional-host-containers-i.patch index b4d1a7149b..33a316a93b 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0019-Add-feature-to-specifiy-additional-host-containers-i.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0019-Add-feature-to-specifiy-additional-host-containers-i.patch @@ -1,4 +1,4 @@ -From f8f9f309f7675eeaf307d24734922002a176e2f0 Mon Sep 17 00:00:00 2001 +From c4fac7513d2806e08d31f6f06f55818d6accb89a Mon Sep 17 00:00:00 2001 From: Victor Pineda Date: Tue, 21 Jun 2022 07:50:19 -0700 Subject: [PATCH 19/34] Add feature to specifiy additional host containers in @@ -1149,5 +1149,5 @@ index e11d335ee..1cf471a08 100644 description: 'CACertPath is the path to the SSL certificate authority used to secure comunications between node -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0020-Add-bottlerocket-custom-bootstrap-containers-config-.patch b/projects/kubernetes-sigs/cluster-api/patches/0020-Add-bottlerocket-custom-bootstrap-containers-config-.patch index dfe8a9f11f..6b4de203b8 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0020-Add-bottlerocket-custom-bootstrap-containers-config-.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0020-Add-bottlerocket-custom-bootstrap-containers-config-.patch @@ -1,4 +1,4 @@ -From bc1f8c5c3404c93dab8efde2f96897edc3f6f172 Mon Sep 17 00:00:00 2001 +From fe2b73e880f5aae02565920f0fad3bb06f193a47 Mon Sep 17 00:00:00 2001 From: Jiayi Wang Date: Mon, 21 Nov 2022 17:31:22 -0500 Subject: [PATCH 20/34] Add bottlerocket custom bootstrap containers config @@ -949,5 +949,5 @@ index 1cf471a08..235ff121f 100644 description: BottlerocketCustomHostContainers contains the information of any additional images that we -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0021-Support-configuring-bottlerocket-admin-container-ima.patch b/projects/kubernetes-sigs/cluster-api/patches/0021-Support-configuring-bottlerocket-admin-container-ima.patch index b69f377573..f3f9c5ca0b 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0021-Support-configuring-bottlerocket-admin-container-ima.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0021-Support-configuring-bottlerocket-admin-container-ima.patch @@ -1,4 +1,4 @@ -From 7e35426496b6857c389e86444d8b7a31b0121b28 Mon Sep 17 00:00:00 2001 +From cf837cbdb469ced07fb59e54fb462e84f2fe4341 Mon Sep 17 00:00:00 2001 From: Jiayi Wang Date: Wed, 23 Nov 2022 09:26:28 -0500 Subject: [PATCH 21/34] Support configuring bottlerocket admin container image @@ -540,5 +540,5 @@ index 235ff121f..e435df3e1 100644 description: BottlerocketBootstrap holds the image source for kubeadm bootstrap container This is only -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0022-Make-bottlerocket-admin-control-custom-bootstrap-con.patch b/projects/kubernetes-sigs/cluster-api/patches/0022-Make-bottlerocket-admin-control-custom-bootstrap-con.patch index 36fb745818..c41af84f92 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0022-Make-bottlerocket-admin-control-custom-bootstrap-con.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0022-Make-bottlerocket-admin-control-custom-bootstrap-con.patch @@ -1,4 +1,4 @@ -From 9e50bbd5b2c8148d2aab683257724f60d22c7045 Mon Sep 17 00:00:00 2001 +From 7e8163f9c06dfc121e9846df4347b1a4b473bbdd Mon Sep 17 00:00:00 2001 From: Jiayi Wang Date: Thu, 5 Jan 2023 14:56:09 -0500 Subject: [PATCH 22/34] Make bottlerocket admin, control, custom bootstrap @@ -113,5 +113,5 @@ index 86c02c2e5..38caa9e1e 100644 for _, tt := range tests { -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0023-Mark-etcd-machine-status-to-running-after-etcd-contr.patch b/projects/kubernetes-sigs/cluster-api/patches/0023-Mark-etcd-machine-status-to-running-after-etcd-contr.patch index 7f3f1619ba..87c19af427 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0023-Mark-etcd-machine-status-to-running-after-etcd-contr.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0023-Mark-etcd-machine-status-to-running-after-etcd-contr.patch @@ -1,4 +1,4 @@ -From f9e4d28a7eb59a9d5c54e181f79b0fcc66635eb5 Mon Sep 17 00:00:00 2001 +From 8d2a0d025ed938f6e0f8ba1eb14b8378f30b41bb Mon Sep 17 00:00:00 2001 From: Jiayi Wang Date: Mon, 9 Jan 2023 15:41:05 -0500 Subject: [PATCH 23/34] Mark etcd machine status to running after etcd @@ -42,5 +42,5 @@ index 4181ca366..5e846594a 100644 } } -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0024-add-support-for-registry-credentials.patch b/projects/kubernetes-sigs/cluster-api/patches/0024-add-support-for-registry-credentials.patch index 725977b667..aaa78a60a3 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0024-add-support-for-registry-credentials.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0024-add-support-for-registry-credentials.patch @@ -1,4 +1,4 @@ -From 29d3cbd905be4c23924c265dcd1320370d625f85 Mon Sep 17 00:00:00 2001 +From d99a986d4aedc37300caa4381ef2724948f4def1 Mon Sep 17 00:00:00 2001 From: Ahree Hong Date: Wed, 14 Dec 2022 12:47:42 -0800 Subject: [PATCH 24/34] add support for registry credentials @@ -236,5 +236,5 @@ index 043764325..17abd5d70 100644 // Purpose is the name to append to the secret generated for a cluster. -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0025-Add-support-for-configuring-NTP-servers-on-bottleroc.patch b/projects/kubernetes-sigs/cluster-api/patches/0025-Add-support-for-configuring-NTP-servers-on-bottleroc.patch index 6b020298a5..a6639b0667 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0025-Add-support-for-configuring-NTP-servers-on-bottleroc.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0025-Add-support-for-configuring-NTP-servers-on-bottleroc.patch @@ -1,4 +1,4 @@ -From ec708aa8320cb37aad778c3fa955a22fb481fe35 Mon Sep 17 00:00:00 2001 +From 1a9397f68159ee7a06db6b12b50c4c41f90f7f84 Mon Sep 17 00:00:00 2001 From: Abhinav Date: Wed, 1 Feb 2023 16:34:23 -0800 Subject: [PATCH 25/34] Add support for configuring NTP servers on bottlerocket @@ -180,5 +180,5 @@ index afaab8a16..fbf7b634f 100644 // requests for reconciliation of KubeadmConfigs. func (r *KubeadmConfigReconciler) ClusterToKubeadmConfigs(o client.Object) []ctrl.Request { -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0026-set-hostname-for-BR-nodes.patch b/projects/kubernetes-sigs/cluster-api/patches/0026-set-hostname-for-BR-nodes.patch index 4202fbc284..fad5478e86 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0026-set-hostname-for-BR-nodes.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0026-set-hostname-for-BR-nodes.patch @@ -1,4 +1,4 @@ -From f3c7f952ef963448ed83f9c6cbff05cb2fa279b9 Mon Sep 17 00:00:00 2001 +From af634bbd184cdcf85b8a86fb8bef636723d85835 Mon Sep 17 00:00:00 2001 From: Ahree Hong Date: Tue, 7 Feb 2023 14:26:36 -0800 Subject: [PATCH 26/34] set hostname for BR nodes @@ -254,5 +254,5 @@ index fbf7b634f..448fbb70b 100644 if scope.Config.Spec.JoinConfiguration.Proxy.HTTPSProxy != "" { bottlerocketConfig.ProxyConfiguration = scope.Config.Spec.JoinConfiguration.Proxy -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0027-Add-bottlerocket-k8s-settings-support.patch b/projects/kubernetes-sigs/cluster-api/patches/0027-Add-bottlerocket-k8s-settings-support.patch index 1f0bf1a03f..b74659345d 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0027-Add-bottlerocket-k8s-settings-support.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0027-Add-bottlerocket-k8s-settings-support.patch @@ -1,4 +1,4 @@ -From e0f3ba677447dc38fd687fbf8345b0cb8db67fbc Mon Sep 17 00:00:00 2001 +From e86bfd17c07ffcce31729e3a35b74f46439b49bb Mon Sep 17 00:00:00 2001 From: Abhinav Pandey Date: Thu, 2 Mar 2023 10:18:07 -0800 Subject: [PATCH 27/34] Add bottlerocket k8s settings support @@ -1446,5 +1446,5 @@ index e435df3e1..1302cc4e1 100644 description: BottlerocketAdmin holds the image source for admin container This is only for bottlerocket -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0028-add-br-kernel.sysctl-settings.patch b/projects/kubernetes-sigs/cluster-api/patches/0028-add-br-kernel.sysctl-settings.patch index 0e82cc83c1..3ba7814fd9 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0028-add-br-kernel.sysctl-settings.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0028-add-br-kernel.sysctl-settings.patch @@ -1,4 +1,4 @@ -From b763eaab9c4f4ad2db555315d8a7b3155ec99119 Mon Sep 17 00:00:00 2001 +From 8aff0194036a40bb4ccedd16a116f4342dbed412 Mon Sep 17 00:00:00 2001 From: Ahree Hong Date: Tue, 7 Mar 2023 14:01:39 -0800 Subject: [PATCH 28/34] add br kernel.sysctl settings @@ -442,5 +442,5 @@ index 1302cc4e1..933f00038 100644 description: Kubernetes holds the kubernetes settings for bottlerocket nodes. -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0029-add-boot-kernel-settings-for-BR.patch b/projects/kubernetes-sigs/cluster-api/patches/0029-add-boot-kernel-settings-for-BR.patch index 8f73bbc40e..fedba71ede 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0029-add-boot-kernel-settings-for-BR.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0029-add-boot-kernel-settings-for-BR.patch @@ -1,4 +1,4 @@ -From 725f03e42dca8dc18787cbb5ac9c9594f1c369c3 Mon Sep 17 00:00:00 2001 +From 1a0527cf83205f1598657d1841a8b645f4313373 Mon Sep 17 00:00:00 2001 From: Ahree Hong Date: Thu, 23 Mar 2023 01:51:16 -0700 Subject: [PATCH 29/34] add boot kernel settings for BR @@ -464,5 +464,5 @@ index 5e846594a..9be6ddb34 100644 }, Type: clusterv1.ClusterSecretType, -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0030-Patch-haproxy-maxconn-value-to-avoid-ulimit-issue.patch b/projects/kubernetes-sigs/cluster-api/patches/0030-Patch-haproxy-maxconn-value-to-avoid-ulimit-issue.patch index b3ea673afc..370d0da585 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0030-Patch-haproxy-maxconn-value-to-avoid-ulimit-issue.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0030-Patch-haproxy-maxconn-value-to-avoid-ulimit-issue.patch @@ -1,4 +1,4 @@ -From 2410c9ab11729e58efe1d4e9e8c9432b2e4abff3 Mon Sep 17 00:00:00 2001 +From 49ad34dc9dc928f2941acca54d942ce99c7bdc64 Mon Sep 17 00:00:00 2001 From: Jackson West Date: Sat, 6 May 2023 14:08:17 -0500 Subject: [PATCH 30/34] Patch haproxy maxconn value to avoid ulimit issue @@ -29,5 +29,5 @@ index 8d2f70a02..1c6e7a68e 100644 resolvers docker nameserver dns 127.0.0.11:53 -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0031-Add-support-for-custom-cert-bundles-in-BR.patch b/projects/kubernetes-sigs/cluster-api/patches/0031-Add-support-for-custom-cert-bundles-in-BR-21.patch similarity index 99% rename from projects/kubernetes-sigs/cluster-api/patches/0031-Add-support-for-custom-cert-bundles-in-BR.patch rename to projects/kubernetes-sigs/cluster-api/patches/0031-Add-support-for-custom-cert-bundles-in-BR-21.patch index 53ca5cb8cd..e1e98ff95d 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0031-Add-support-for-custom-cert-bundles-in-BR.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0031-Add-support-for-custom-cert-bundles-in-BR-21.patch @@ -1,4 +1,4 @@ -From f5bd074026b2c0dd2ff7b13b413bb983fb8af5dd Mon Sep 17 00:00:00 2001 +From c9c73a189cc89abdc412321023fb0a36d35eebf7 Mon Sep 17 00:00:00 2001 From: ahreehong <46465244+ahreehong@users.noreply.github.com> Date: Fri, 19 May 2023 16:29:08 -0400 Subject: [PATCH 31/34] Add support for custom cert bundles in BR (#21) @@ -586,5 +586,5 @@ index a79e90dea..7821a39d5 100644 description: ControlPlane defines the additional control plane instance to be deployed on the joining node. -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0032-CAPI-Move-Cluster-Filter.patch b/projects/kubernetes-sigs/cluster-api/patches/0032-CAPI-Move-Cluster-Filter.patch index 5eb7a3d058..180d300148 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0032-CAPI-Move-Cluster-Filter.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0032-CAPI-Move-Cluster-Filter.patch @@ -1,4 +1,4 @@ -From 1ce9e7bf49e4a89b7ad50b2e5a1e426a50bf048c Mon Sep 17 00:00:00 2001 +From 2d7b64dbc81da3370fe028e0eca58a358236a263 Mon Sep 17 00:00:00 2001 From: Vignesh Goutham Ganesh Date: Tue, 16 May 2023 11:03:09 -0500 Subject: [PATCH 32/34] CAPI Move Cluster Filter @@ -466,5 +466,5 @@ index c75557e0a..04b1ef8fe 100644 }) } -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0033-Move-objects-with-force-move-label-and-no-cluster-te.patch b/projects/kubernetes-sigs/cluster-api/patches/0033-Move-objects-with-force-move-label-and-no-cluster-te.patch index fdfe45f7fa..443fb5f2a2 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0033-Move-objects-with-force-move-label-and-no-cluster-te.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0033-Move-objects-with-force-move-label-and-no-cluster-te.patch @@ -1,4 +1,4 @@ -From c08dce3506634939f779de29e268785834d2d383 Mon Sep 17 00:00:00 2001 +From 8f09f40abf6fc48d7baa8c85a2c20faab185fc33 Mon Sep 17 00:00:00 2001 From: Vignesh Goutham Ganesh Date: Tue, 30 May 2023 10:14:31 -0500 Subject: [PATCH 33/34] Move objects with force move label and no cluster @@ -84,5 +84,5 @@ index 46572d62f..9100880e1 100644 for _, tt := range tests { -- -2.40.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0034-allow-registry-mirror-configurations-to-be-mutable-f.patch b/projects/kubernetes-sigs/cluster-api/patches/0034-allow-registry-mirror-configurations-to-be-mutable-f.patch index 0b1d15ffec..2e1e9f4cd0 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0034-allow-registry-mirror-configurations-to-be-mutable-f.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0034-allow-registry-mirror-configurations-to-be-mutable-f.patch @@ -1,4 +1,4 @@ -From 1eb1248e4cdb4d18d22a82cef691d005ef89c0f8 Mon Sep 17 00:00:00 2001 +From a12cbf1f9cf870358ba8d969f1c48cef4e28560c Mon Sep 17 00:00:00 2001 From: Cavaughn Browne Date: Thu, 20 Jul 2023 11:05:49 -0500 Subject: [PATCH 34/34] allow registry mirror configurations to be mutable for @@ -107,5 +107,5 @@ index 38caa9e1e..45eb1976e 100644 for _, tt := range tests { -- -2.40.0 +2.34.1