Skip to content

Commit

Permalink
add unstacked-etcd fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tatlat committed Sep 8, 2023
1 parent 56cf141 commit 7cec581
Show file tree
Hide file tree
Showing 35 changed files with 62 additions and 43 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 1fd9c28a602af9f49d542471310b520463a6d949 Mon Sep 17 00:00:00 2001
From 8198a765670646a0e95c759620cacc04d32c2c1b Mon Sep 17 00:00:00 2001
From: Rajashree Mandaogane <[email protected]>
Date: Mon, 28 Jun 2021 13:44:50 -0700
Subject: [PATCH 02/36] Add unstacked etcd support
Expand Down Expand Up @@ -80,7 +80,7 @@ commits on the new 1.0.1 branch. This commit adds back the permission.
controllers/external/util.go | 10 ++
.../v1beta1/kubeadm_control_plane_webhook.go | 1 +
controlplane/kubeadm/config/rbac/role.yaml | 9 ++
.../internal/controllers/controller.go | 39 +++++
.../internal/controllers/controller.go | 51 ++++++-
.../controllers/cluster/cluster_controller.go | 90 ++++++++++-
.../cluster/cluster_controller_phases.go | 108 +++++++++++++
.../cluster/cluster_controller_test.go | 134 ++++++++++++++++
Expand All @@ -92,7 +92,7 @@ commits on the new 1.0.1 branch. This commit adds back the permission.
util/secret/certificates.go | 3 +
util/secret/consts.go | 2 +
util/util.go | 6 +
26 files changed, 856 insertions(+), 20 deletions(-)
26 files changed, 862 insertions(+), 26 deletions(-)

diff --git a/api/v1alpha3/cluster_types.go b/api/v1alpha3/cluster_types.go
index 2421a2796..88f945742 100644
Expand Down Expand Up @@ -570,7 +570,7 @@ index ec2334e96..5c7e70401 100644
+ - update
+ - watch
diff --git a/controlplane/kubeadm/internal/controllers/controller.go b/controlplane/kubeadm/internal/controllers/controller.go
index 73c2ae7b9..ed84db02c 100644
index 73c2ae7b9..32ac8592c 100644
--- a/controlplane/kubeadm/internal/controllers/controller.go
+++ b/controlplane/kubeadm/internal/controllers/controller.go
@@ -19,6 +19,8 @@ package controllers
Expand Down Expand Up @@ -631,22 +631,41 @@ index 73c2ae7b9..ed84db02c 100644
// Add finalizer first if not set to avoid the race condition between init and delete.
// Note: Finalizers in general can only be added when the deletionTimestamp is not set.
if kcp.ObjectMeta.DeletionTimestamp.IsZero() && !controllerutil.ContainsFinalizer(kcp, controlplanev1.KubeadmControlPlaneFinalizer) {
@@ -520,6 +550,15 @@ func (r *KubeadmControlPlaneReconciler) reconcileDelete(ctx context.Context, con
@@ -520,6 +550,21 @@ func (r *KubeadmControlPlaneReconciler) reconcileDelete(ctx context.Context, con
log := ctrl.LoggerFrom(ctx)
log.Info("Reconcile KubeadmControlPlane deletion")

+ // Gets all machines, not just control plane machines.
+ allMachines, err := r.managementCluster.GetMachinesForCluster(ctx, controlPlane.Cluster)
+ if err != nil {
+ return ctrl.Result{}, err
+ }
+
+ if controlPlane.Cluster.Spec.ManagedExternalEtcdRef != nil {
+ for _, machine := range controlPlane.Machines {
+ for _, machine := range allMachines {
+ if util.IsEtcdMachine(machine) {
+ // remove external etcd-only machines from the "Machines" collection so that the controlplane machines don't wait for etcd to be deleted first
+ delete(controlPlane.Machines, machine.Name)
+ // remove external etcd-only machines from the "allMachines" collection so that the controlplane machines don't wait for etcd to be deleted first
+ delete(allMachines, machine.Name)
+ }
+ }
+ }
+
// If no control plane machines remain, remove the finalizer
if len(controlPlane.Machines) == 0 {
controllerutil.RemoveFinalizer(controlPlane.KCP, controlplanev1.KubeadmControlPlaneFinalizer)
@@ -538,12 +583,6 @@ func (r *KubeadmControlPlaneReconciler) reconcileDelete(ctx context.Context, con
// all the machines are deleted in parallel.
conditions.SetAggregate(controlPlane.KCP, controlplanev1.MachinesReadyCondition, controlPlane.Machines.ConditionGetters(), conditions.AddSourceRef(), conditions.WithStepCounterIf(false))

- // Gets all machines, not just control plane machines.
- allMachines, err := r.managementCluster.GetMachinesForCluster(ctx, controlPlane.Cluster)
- if err != nil {
- return ctrl.Result{}, err
- }
-
allMachinePools := &expv1.MachinePoolList{}
// Get all machine pools.
if feature.Gates.Enabled(feature.MachinePool) {
diff --git a/internal/controllers/cluster/cluster_controller.go b/internal/controllers/cluster/cluster_controller.go
index 7654b788a..269007490 100644
--- a/internal/controllers/cluster/cluster_controller.go
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 97ce4360ab41418520cd442cc90cc53e05a1d6f3 Mon Sep 17 00:00:00 2001
From e7930eb837a1897ee48ce19a353557110204370d Mon Sep 17 00:00:00 2001
From: Rajashree Mandaogane <[email protected]>
Date: Fri, 6 Aug 2021 17:16:39 -0700
Subject: [PATCH 03/36] Unstacked etcd and controlplane upgrade
Expand Down Expand Up @@ -178,7 +178,7 @@ index e9870d34c..adc1b2a0a 100644

const (
diff --git a/controlplane/kubeadm/internal/controllers/controller.go b/controlplane/kubeadm/internal/controllers/controller.go
index ed84db02c..df63ef602 100644
index 32ac8592c..1523fa50d 100644
--- a/controlplane/kubeadm/internal/controllers/controller.go
+++ b/controlplane/kubeadm/internal/controllers/controller.go
@@ -25,6 +25,7 @@ import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 2d4381a10806cfbb162087902c154490d70ef5d2 Mon Sep 17 00:00:00 2001
From 7900e8cb1a292163e6e5754fd6f49d24807e8d4a Mon Sep 17 00:00:00 2001
From: Guillermo Gaston <[email protected]>
Date: Thu, 19 Aug 2021 21:52:52 +0000
Subject: [PATCH 04/36] Patch config path in kubevip manifest for kubeadm
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 42fab735e575e90e5cfe7964225c7152370bafde Mon Sep 17 00:00:00 2001
From afd881d229118fda4eb3062d7fee89ac71336ca8 Mon Sep 17 00:00:00 2001
From: Guillermo Gaston <[email protected]>
Date: Tue, 31 Aug 2021 15:56:28 +0000
Subject: [PATCH 05/36] Make pause and bottlerocket bootstrap images updatable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 29fdd123bbd6fca4ce09b014526a771ae3b4cec7 Mon Sep 17 00:00:00 2001
From ad4e5c5ffdfbb68d7d13f01393920efe4d388b13 Mon Sep 17 00:00:00 2001
From: Abhinav Pandey <[email protected]>
Date: Tue, 21 Sep 2021 08:57:56 -0700
Subject: [PATCH 06/36] add support for registry mirror for bottlerocket
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From c0c0fd9f1c09e9db8dd4c47198292534676aebb1 Mon Sep 17 00:00:00 2001
From 3be419efd31f202fabfd7b6039135655dac5bb0f Mon Sep 17 00:00:00 2001
From: Rajashree Mandaogane <[email protected]>
Date: Thu, 30 Sep 2021 14:04:36 -0700
Subject: [PATCH 07/36] Fix proxy template for bottlerocket bootstrap
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 07ca2ce1d145334a17daf0bf8286a646a297b796 Mon Sep 17 00:00:00 2001
From 4b719a7b4f04f539012d8ad77b8f671588a12ace Mon Sep 17 00:00:00 2001
From: Rajashree Mandaogane <[email protected]>
Date: Sun, 21 Nov 2021 01:16:11 -0800
Subject: [PATCH 08/36] Update core conversion spoke versions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 354b12e767000b25ef93d7fdb21c72a7e3452956 Mon Sep 17 00:00:00 2001
From 034aa02ab5bfd7a5abddcdf3a662070357903d50 Mon Sep 17 00:00:00 2001
From: Rajashree Mandaogane <[email protected]>
Date: Sun, 21 Nov 2021 20:59:58 -0800
Subject: [PATCH 09/36] Add bottlerocket changes to capbk v1alpha4 api
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 193d8f0a7dc652d866d9671a74acadabf1234abc Mon Sep 17 00:00:00 2001
From ec12ef73b361562bb202c6be2a5876b7a6812282 Mon Sep 17 00:00:00 2001
From: Rajashree Mandaogane <[email protected]>
Date: Sun, 21 Nov 2021 21:00:31 -0800
Subject: [PATCH 10/36] Update capbk converions spoke version
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 484b558b84e7bff4dc0a08b488d068d30ed55084 Mon Sep 17 00:00:00 2001
From 6fce290a42e60fd813e33f4ffd7f591378d6fa67 Mon Sep 17 00:00:00 2001
From: Vivek Koppuru <[email protected]>
Date: Wed, 12 Jan 2022 19:04:15 -0800
Subject: [PATCH 11/36] Add status.version to list of fields to ignore for
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 58039a0eea156986dbf7b21da828ded8fe6b54d6 Mon Sep 17 00:00:00 2001
From 932af8c90d4a27ecf66cd7b8289d4f1f6b5382f9 Mon Sep 17 00:00:00 2001
From: Vivek Koppuru <[email protected]>
Date: Mon, 24 Jan 2022 00:46:44 -0800
Subject: [PATCH 12/36] Add node labels support for bottlerocket
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From d926e9c8a7a9e9783fe302f4764d84b4d2e5a6c2 Mon Sep 17 00:00:00 2001
From 44cf6270b1dd9d58f078a9037fe76085688ec0a0 Mon Sep 17 00:00:00 2001
From: Daniel Budris <[email protected]>
Date: Fri, 17 Dec 2021 13:38:39 -0800
Subject: [PATCH 13/36] Support worker node taints
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From b377d525bde10a373994e13d7e24a8b672b1028e Mon Sep 17 00:00:00 2001
From 8ab8f0ee0f12c74767a30b84449d7f0312a1cd0a Mon Sep 17 00:00:00 2001
From: danbudris <[email protected]>
Date: Fri, 18 Feb 2022 09:24:32 -0500
Subject: [PATCH 14/36] support bottle rocket control plane taints
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 5e3e7d7f1c36184479a395bdd96c003d8d70d2c6 Mon Sep 17 00:00:00 2001
From 5ae87ff29d90971d7ea9728fd4e56a78eef8ef09 Mon Sep 17 00:00:00 2001
From: Michael Chu <[email protected]>
Date: Mon, 28 Feb 2022 09:51:25 -0800
Subject: [PATCH 15/36] Support configuring bottlerocket control container uri
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From fc24b8117ea24ba5e14562a559fd3bae26f03c70 Mon Sep 17 00:00:00 2001
From 19f450847c2dcfa02a65ae7bfa6ff1dc2bb1ce59 Mon Sep 17 00:00:00 2001
From: Rajashree Mandaogane <[email protected]>
Date: Thu, 3 Mar 2022 15:01:35 -0800
Subject: [PATCH 16/36] Change format for storing etcd machine address
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From c445db4badd881a71634ef8855ff2e881e316220 Mon Sep 17 00:00:00 2001
From c770571e1e73ee671a1f21c542268530c486e7ec Mon Sep 17 00:00:00 2001
From: Vignesh Goutham Ganesh <[email protected]>
Date: Wed, 8 Jun 2022 10:27:26 -0700
Subject: [PATCH 17/36] Parse provider-id from kubelet extra args
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 0e3b14732b35394faa12684b2eaae1bdca92217f Mon Sep 17 00:00:00 2001
From a90a779345a75465d35a1247fcc28615bdcae7b0 Mon Sep 17 00:00:00 2001
From: Victor Pineda <[email protected]>
Date: Sun, 19 Jun 2022 10:39:50 -0700
Subject: [PATCH 18/36] Add bottlerocket control image on nodes joining a new
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 24386cba94d014b98d6f54b59c9c62899f533534 Mon Sep 17 00:00:00 2001
From 707d70c7d7bfdcf81a4dfb21b57062b5cd5e58f1 Mon Sep 17 00:00:00 2001
From: Victor Pineda <[email protected]>
Date: Tue, 21 Jun 2022 07:50:19 -0700
Subject: [PATCH 19/36] Add feature to specifiy additional host containers in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 7c8392744147b3e2fde64fe3cccd121bc1ba1389 Mon Sep 17 00:00:00 2001
From e28eba23046990bcaac7f5876f1059ef45e85145 Mon Sep 17 00:00:00 2001
From: Jiayi Wang <[email protected]>
Date: Mon, 21 Nov 2022 17:31:22 -0500
Subject: [PATCH 20/36] Add bottlerocket custom bootstrap containers config
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 5bbb5d26343ab7904e5f3368d786d32341a70783 Mon Sep 17 00:00:00 2001
From 1759ca38f3d5ab7b0bda9153bf97a169c610998c Mon Sep 17 00:00:00 2001
From: Jiayi Wang <[email protected]>
Date: Wed, 23 Nov 2022 09:26:28 -0500
Subject: [PATCH 21/36] Support configuring bottlerocket admin container image
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From cb49ca2a5c8ed241952402a4ecdf2ed2c74651af Mon Sep 17 00:00:00 2001
From 7cef47a73f5bea9bb798a1b14c3da1c5cb03def7 Mon Sep 17 00:00:00 2001
From: Jiayi Wang <[email protected]>
Date: Thu, 5 Jan 2023 14:56:09 -0500
Subject: [PATCH 22/36] Make bottlerocket admin, control, custom bootstrap
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 9607ce2f650fee1f9efa03153652f812374b0bc7 Mon Sep 17 00:00:00 2001
From 74f2e32b907c35d94bb1369283037aa785f42aae Mon Sep 17 00:00:00 2001
From: Jiayi Wang <[email protected]>
Date: Mon, 9 Jan 2023 15:41:05 -0500
Subject: [PATCH 23/36] Mark etcd machine status to running after etcd
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 00293957a8f3a1cc230c42d2f6e1070487c60cd7 Mon Sep 17 00:00:00 2001
From bb343e0a4cc449fb012054f852f798fc1d52c4cc Mon Sep 17 00:00:00 2001
From: Ahree Hong <[email protected]>
Date: Wed, 14 Dec 2022 12:47:42 -0800
Subject: [PATCH 24/36] add support for registry credentials
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From ee81b4261cbd94b7b21521de59180e169c7a94c8 Mon Sep 17 00:00:00 2001
From 427ca3e03758953fe9199187286d177fc7cbfbd4 Mon Sep 17 00:00:00 2001
From: Abhinav <[email protected]>
Date: Wed, 1 Feb 2023 16:34:23 -0800
Subject: [PATCH 25/36] Add support for configuring NTP servers on bottlerocket
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From f098bdc6907053c10453f84710210f35edf79de0 Mon Sep 17 00:00:00 2001
From 621fa443c8136b5f8836524a6367927e422aef5e Mon Sep 17 00:00:00 2001
From: Ahree Hong <[email protected]>
Date: Tue, 7 Feb 2023 14:26:36 -0800
Subject: [PATCH 26/36] set hostname for BR nodes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 1caf2f91a2602d5831103b6710d25c6de1369e7d Mon Sep 17 00:00:00 2001
From 973bdb11665402451e8109b66aacbc4efbff1237 Mon Sep 17 00:00:00 2001
From: Abhinav Pandey <[email protected]>
Date: Thu, 2 Mar 2023 10:18:07 -0800
Subject: [PATCH 27/36] Add bottlerocket k8s settings support
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From d712e63b352509bdb8f23620a535bfcd07df34e8 Mon Sep 17 00:00:00 2001
From dde5c5e64c68f851801fd0f7d778445873e8967e Mon Sep 17 00:00:00 2001
From: Ahree Hong <[email protected]>
Date: Tue, 7 Mar 2023 14:01:39 -0800
Subject: [PATCH 28/36] add br kernel.sysctl settings
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From e3bfbd6a3fbe053533bf0cf2bc2efd92e4e274cb Mon Sep 17 00:00:00 2001
From b765b247439f117a142bf3c5081fc3555c5938e3 Mon Sep 17 00:00:00 2001
From: Ahree Hong <[email protected]>
Date: Thu, 23 Mar 2023 01:51:16 -0700
Subject: [PATCH 29/36] add boot kernel settings for BR
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From d3b4d90b5b18eaa738c615d4a1ee049d4371ee37 Mon Sep 17 00:00:00 2001
From 8944b25b69094343d2972a7e5f466596145d95f1 Mon Sep 17 00:00:00 2001
From: Jackson West <[email protected]>
Date: Sat, 6 May 2023 14:08:17 -0500
Subject: [PATCH 30/36] Patch haproxy maxconn value to avoid ulimit issue
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 0dff33731726496deb620e97a23dfcda29077cdd Mon Sep 17 00:00:00 2001
From 08e39d1e5a505e55dac4a782590d3f85a44b9da4 Mon Sep 17 00:00:00 2001
From: ahreehong <[email protected]>
Date: Fri, 19 May 2023 16:29:08 -0400
Subject: [PATCH 31/36] Add support for custom cert bundles in BR (#21)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 2ec78e02a46eebae56ae1d17cadd5d2bc2180e6f Mon Sep 17 00:00:00 2001
From 860740678154be68925764f8f8a1eb89f6133cf0 Mon Sep 17 00:00:00 2001
From: Vignesh Goutham Ganesh <[email protected]>
Date: Tue, 16 May 2023 11:03:09 -0500
Subject: [PATCH 32/36] CAPI Move Cluster Filter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From b10c2210be1ca26cab2c8cff6a6bc82ca14c6076 Mon Sep 17 00:00:00 2001
From f1f5c36be9d28a02958a0633878ca3d8f3251349 Mon Sep 17 00:00:00 2001
From: Vignesh Goutham Ganesh <[email protected]>
Date: Tue, 30 May 2023 10:14:31 -0500
Subject: [PATCH 33/36] Move objects with force move label and no cluster
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 6b29e8b329c5beee8c417640b7db7f42f93b5d9e Mon Sep 17 00:00:00 2001
From 9b0025e7f2d75f8928a24c8391824acb41c32d67 Mon Sep 17 00:00:00 2001
From: Cavaughn Browne <[email protected]>
Date: Thu, 20 Jul 2023 11:05:49 -0500
Subject: [PATCH 34/36] allow registry mirror configurations to be mutable for
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 377ee1cd715461499c7bae4016dbbbaf681683e3 Mon Sep 17 00:00:00 2001
From 63e2c2082b3fe6940de33ed610f248b602813e00 Mon Sep 17 00:00:00 2001
From: Prow Bot <[email protected]>
Date: Wed, 16 Aug 2023 19:58:01 -0700
Subject: [PATCH 35/36] Add support for external etcd machines in Kind mapper
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 9cc0f2b3429cfe29f4dd1fbc30f6ec12a9f691d3 Mon Sep 17 00:00:00 2001
From f1d39fd62ce2d5c9b10b4b6832a8bb78558a7d64 Mon Sep 17 00:00:00 2001
From: Jackson West <[email protected]>
Date: Sat, 19 Aug 2023 09:35:39 -0500
Subject: [PATCH 36/36] disable cgroupns=private to fix AL2
Expand Down

0 comments on commit 7cec581

Please sign in to comment.