From 66c71a6425ac5fb9b5bbeb0fd2f6e6e04e888d85 Mon Sep 17 00:00:00 2001 From: Mahesh Kagitha Date: Thu, 24 Oct 2024 11:24:01 -0500 Subject: [PATCH 1/3] ccm-patch for 1-31 004 --- ...stanceExistsGracePeriod-to-cloud-nod.patch | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 projects/kubernetes/cloud-provider-aws/1-31/patches/0004-EKS-PATCH-Add-instanceExistsGracePeriod-to-cloud-nod.patch diff --git a/projects/kubernetes/cloud-provider-aws/1-31/patches/0004-EKS-PATCH-Add-instanceExistsGracePeriod-to-cloud-nod.patch b/projects/kubernetes/cloud-provider-aws/1-31/patches/0004-EKS-PATCH-Add-instanceExistsGracePeriod-to-cloud-nod.patch new file mode 100644 index 0000000000..8070b427dd --- /dev/null +++ b/projects/kubernetes/cloud-provider-aws/1-31/patches/0004-EKS-PATCH-Add-instanceExistsGracePeriod-to-cloud-nod.patch @@ -0,0 +1,75 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Carter McKinnon +Date: Wed, 16 Oct 2024 08:40:14 -0700 +Subject: [PATCH] --EKS-PATCH-- Add instanceExistsGracePeriod to + cloud-node-lifecycle-controller + +--- + .../node_lifecycle_controller.go | 32 ++++++++++++++++--- + 1 file changed, 28 insertions(+), 4 deletions(-) + +diff --git a/vendor/k8s.io/cloud-provider/controllers/nodelifecycle/node_lifecycle_controller.go b/vendor/k8s.io/cloud-provider/controllers/nodelifecycle/node_lifecycle_controller.go +index 2c1e63dae39..97e4bd4f5c4 100644 +--- a/vendor/k8s.io/cloud-provider/controllers/nodelifecycle/node_lifecycle_controller.go ++++ b/vendor/k8s.io/cloud-provider/controllers/nodelifecycle/node_lifecycle_controller.go +@@ -19,6 +19,8 @@ package cloud + import ( + "context" + "errors" ++ "fmt" ++ "os" + "time" + + v1 "k8s.io/api/core/v1" +@@ -66,6 +68,9 @@ type CloudNodeLifecycleController struct { + // check node status posted from kubelet. This value should be lower than nodeMonitorGracePeriod + // set in controller-manager + nodeMonitorPeriod time.Duration ++ ++ // Period of time after Node creation that the controller will assume the corresponding cloud instance exists ++ instanceExistsGracePeriod time.Duration + } + + func NewCloudNodeLifecycleController( +@@ -88,11 +93,24 @@ func NewCloudNodeLifecycleController( + return nil, errors.New("cloud provider does not support instances") + } + ++ var instanceExistsGracePeriod time.Duration ++ instanceExistsGracePeriodFromEnv := os.Getenv("NODE_LIFECYCLE_CONTROLLER_INSTANCE_EXISTS_GRACE_PERIOD") ++ if instanceExistsGracePeriodFromEnv != "" { ++ if period, err := time.ParseDuration(instanceExistsGracePeriodFromEnv); err != nil { ++ return nil, fmt.Errorf("invalid NODE_LIFECYCLE_CONTROLLER_INSTANCE_EXISTS_GRACE_PERIOD: '%s': %v", instanceExistsGracePeriodFromEnv, err) ++ } else { ++ instanceExistsGracePeriod = period ++ } ++ } else { ++ instanceExistsGracePeriod = 2 * time.Minute ++ } ++ + c := &CloudNodeLifecycleController{ +- kubeClient: kubeClient, +- nodeLister: nodeInformer.Lister(), +- cloud: cloud, +- nodeMonitorPeriod: nodeMonitorPeriod, ++ kubeClient: kubeClient, ++ nodeLister: nodeInformer.Lister(), ++ cloud: cloud, ++ nodeMonitorPeriod: nodeMonitorPeriod, ++ instanceExistsGracePeriod: instanceExistsGracePeriod, + } + + return c, nil +@@ -149,6 +167,12 @@ func (c *CloudNodeLifecycleController) MonitorNodes(ctx context.Context) { + continue + } + ++ // skip the node if it was recently created, it may not have propagated in cloud provider yet ++ if time.Since(node.CreationTimestamp.Time) < c.instanceExistsGracePeriod { ++ klog.Infof("skipping node %s that was created within grace period (%v)", node.Name, c.instanceExistsGracePeriod) ++ continue ++ } ++ + // At this point the node has NotReady status, we need to check if the node has been removed + // from the cloud provider. If node cannot be found in cloudprovider, then delete the node + exists, err := c.ensureNodeExistsByProviderID(ctx, node) From 560dbe4f1922215963174b6ae237d85040471820 Mon Sep 17 00:00:00 2001 From: Mahesh Kagitha Date: Thu, 24 Oct 2024 11:28:43 -0500 Subject: [PATCH 2/3] 004 patch files for 1-30, 1-29, 1-28 --- ...stanceExistsGracePeriod-to-cloud-nod.patch | 83 +++++++++++++++++++ ...stanceExistsGracePeriod-to-cloud-nod.patch | 83 +++++++++++++++++++ ...stanceExistsGracePeriod-to-cloud-nod.patch | 83 +++++++++++++++++++ 3 files changed, 249 insertions(+) create mode 100644 projects/kubernetes/cloud-provider-aws/1-28/patches/0004-EKS-PATCH-Add-instanceExistsGracePeriod-to-cloud-nod.patch create mode 100644 projects/kubernetes/cloud-provider-aws/1-29/patches/0004-EKS-PATCH-Add-instanceExistsGracePeriod-to-cloud-nod.patch create mode 100644 projects/kubernetes/cloud-provider-aws/1-30/patches/0004-EKS-PATCH-Add-instanceExistsGracePeriod-to-cloud-nod.patch diff --git a/projects/kubernetes/cloud-provider-aws/1-28/patches/0004-EKS-PATCH-Add-instanceExistsGracePeriod-to-cloud-nod.patch b/projects/kubernetes/cloud-provider-aws/1-28/patches/0004-EKS-PATCH-Add-instanceExistsGracePeriod-to-cloud-nod.patch new file mode 100644 index 0000000000..4017d5c514 --- /dev/null +++ b/projects/kubernetes/cloud-provider-aws/1-28/patches/0004-EKS-PATCH-Add-instanceExistsGracePeriod-to-cloud-nod.patch @@ -0,0 +1,83 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Carter McKinnon +Date: Wed, 16 Oct 2024 08:53:29 -0700 +Subject: [PATCH] --EKS-PATCH-- Add instanceExistsGracePeriod to + cloud-node-lifecycle-controller + +--- + .../node_lifecycle_controller.go | 38 +++++++++++++++---- + 1 file changed, 31 insertions(+), 7 deletions(-) + +diff --git a/vendor/k8s.io/cloud-provider/controllers/nodelifecycle/node_lifecycle_controller.go b/vendor/k8s.io/cloud-provider/controllers/nodelifecycle/node_lifecycle_controller.go +index b8a50e42cdd..50b0b896478 100644 +--- a/vendor/k8s.io/cloud-provider/controllers/nodelifecycle/node_lifecycle_controller.go ++++ b/vendor/k8s.io/cloud-provider/controllers/nodelifecycle/node_lifecycle_controller.go +@@ -19,9 +19,11 @@ package cloud + import ( + "context" + "errors" ++ "fmt" ++ "os" + "time" + +- "k8s.io/api/core/v1" ++ v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/types" +@@ -65,6 +67,9 @@ type CloudNodeLifecycleController struct { + // check node status posted from kubelet. This value should be lower than nodeMonitorGracePeriod + // set in controller-manager + nodeMonitorPeriod time.Duration ++ ++ // Period of time after Node creation that the controller will assume the corresponding cloud instance exists ++ instanceExistsGracePeriod time.Duration + } + + func NewCloudNodeLifecycleController( +@@ -90,13 +95,26 @@ func NewCloudNodeLifecycleController( + return nil, errors.New("cloud provider does not support instances") + } + ++ var instanceExistsGracePeriod time.Duration ++ instanceExistsGracePeriodFromEnv := os.Getenv("NODE_LIFECYCLE_CONTROLLER_INSTANCE_EXISTS_GRACE_PERIOD") ++ if instanceExistsGracePeriodFromEnv != "" { ++ if period, err := time.ParseDuration(instanceExistsGracePeriodFromEnv); err != nil { ++ return nil, fmt.Errorf("invalid NODE_LIFECYCLE_CONTROLLER_INSTANCE_EXISTS_GRACE_PERIOD: '%s': %v", instanceExistsGracePeriodFromEnv, err) ++ } else { ++ instanceExistsGracePeriod = period ++ } ++ } else { ++ instanceExistsGracePeriod = 2 * time.Minute ++ } ++ + c := &CloudNodeLifecycleController{ +- kubeClient: kubeClient, +- nodeLister: nodeInformer.Lister(), +- broadcaster: eventBroadcaster, +- recorder: recorder, +- cloud: cloud, +- nodeMonitorPeriod: nodeMonitorPeriod, ++ kubeClient: kubeClient, ++ nodeLister: nodeInformer.Lister(), ++ broadcaster: eventBroadcaster, ++ recorder: recorder, ++ cloud: cloud, ++ nodeMonitorPeriod: nodeMonitorPeriod, ++ instanceExistsGracePeriod: instanceExistsGracePeriod, + } + + return c, nil +@@ -150,6 +168,12 @@ func (c *CloudNodeLifecycleController) MonitorNodes(ctx context.Context) { + continue + } + ++ // skip the node if it was recently created, it may not have propagated in cloud provider yet ++ if time.Since(node.CreationTimestamp.Time) < c.instanceExistsGracePeriod { ++ klog.Infof("skipping node %s that was created within grace period (%v)", node.Name, c.instanceExistsGracePeriod) ++ continue ++ } ++ + // At this point the node has NotReady status, we need to check if the node has been removed + // from the cloud provider. If node cannot be found in cloudprovider, then delete the node + exists, err := c.ensureNodeExistsByProviderID(ctx, node) diff --git a/projects/kubernetes/cloud-provider-aws/1-29/patches/0004-EKS-PATCH-Add-instanceExistsGracePeriod-to-cloud-nod.patch b/projects/kubernetes/cloud-provider-aws/1-29/patches/0004-EKS-PATCH-Add-instanceExistsGracePeriod-to-cloud-nod.patch new file mode 100644 index 0000000000..f1672dbaa1 --- /dev/null +++ b/projects/kubernetes/cloud-provider-aws/1-29/patches/0004-EKS-PATCH-Add-instanceExistsGracePeriod-to-cloud-nod.patch @@ -0,0 +1,83 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Carter McKinnon +Date: Wed, 16 Oct 2024 08:50:40 -0700 +Subject: [PATCH] --EKS-PATCH-- Add instanceExistsGracePeriod to + cloud-node-lifecycle-controller + +--- + .../node_lifecycle_controller.go | 38 +++++++++++++++---- + 1 file changed, 31 insertions(+), 7 deletions(-) + +diff --git a/vendor/k8s.io/cloud-provider/controllers/nodelifecycle/node_lifecycle_controller.go b/vendor/k8s.io/cloud-provider/controllers/nodelifecycle/node_lifecycle_controller.go +index b8a50e42cdd..50b0b896478 100644 +--- a/vendor/k8s.io/cloud-provider/controllers/nodelifecycle/node_lifecycle_controller.go ++++ b/vendor/k8s.io/cloud-provider/controllers/nodelifecycle/node_lifecycle_controller.go +@@ -19,9 +19,11 @@ package cloud + import ( + "context" + "errors" ++ "fmt" ++ "os" + "time" + +- "k8s.io/api/core/v1" ++ v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/types" +@@ -65,6 +67,9 @@ type CloudNodeLifecycleController struct { + // check node status posted from kubelet. This value should be lower than nodeMonitorGracePeriod + // set in controller-manager + nodeMonitorPeriod time.Duration ++ ++ // Period of time after Node creation that the controller will assume the corresponding cloud instance exists ++ instanceExistsGracePeriod time.Duration + } + + func NewCloudNodeLifecycleController( +@@ -90,13 +95,26 @@ func NewCloudNodeLifecycleController( + return nil, errors.New("cloud provider does not support instances") + } + ++ var instanceExistsGracePeriod time.Duration ++ instanceExistsGracePeriodFromEnv := os.Getenv("NODE_LIFECYCLE_CONTROLLER_INSTANCE_EXISTS_GRACE_PERIOD") ++ if instanceExistsGracePeriodFromEnv != "" { ++ if period, err := time.ParseDuration(instanceExistsGracePeriodFromEnv); err != nil { ++ return nil, fmt.Errorf("invalid NODE_LIFECYCLE_CONTROLLER_INSTANCE_EXISTS_GRACE_PERIOD: '%s': %v", instanceExistsGracePeriodFromEnv, err) ++ } else { ++ instanceExistsGracePeriod = period ++ } ++ } else { ++ instanceExistsGracePeriod = 2 * time.Minute ++ } ++ + c := &CloudNodeLifecycleController{ +- kubeClient: kubeClient, +- nodeLister: nodeInformer.Lister(), +- broadcaster: eventBroadcaster, +- recorder: recorder, +- cloud: cloud, +- nodeMonitorPeriod: nodeMonitorPeriod, ++ kubeClient: kubeClient, ++ nodeLister: nodeInformer.Lister(), ++ broadcaster: eventBroadcaster, ++ recorder: recorder, ++ cloud: cloud, ++ nodeMonitorPeriod: nodeMonitorPeriod, ++ instanceExistsGracePeriod: instanceExistsGracePeriod, + } + + return c, nil +@@ -150,6 +168,12 @@ func (c *CloudNodeLifecycleController) MonitorNodes(ctx context.Context) { + continue + } + ++ // skip the node if it was recently created, it may not have propagated in cloud provider yet ++ if time.Since(node.CreationTimestamp.Time) < c.instanceExistsGracePeriod { ++ klog.Infof("skipping node %s that was created within grace period (%v)", node.Name, c.instanceExistsGracePeriod) ++ continue ++ } ++ + // At this point the node has NotReady status, we need to check if the node has been removed + // from the cloud provider. If node cannot be found in cloudprovider, then delete the node + exists, err := c.ensureNodeExistsByProviderID(ctx, node) diff --git a/projects/kubernetes/cloud-provider-aws/1-30/patches/0004-EKS-PATCH-Add-instanceExistsGracePeriod-to-cloud-nod.patch b/projects/kubernetes/cloud-provider-aws/1-30/patches/0004-EKS-PATCH-Add-instanceExistsGracePeriod-to-cloud-nod.patch new file mode 100644 index 0000000000..b3d2e5ee27 --- /dev/null +++ b/projects/kubernetes/cloud-provider-aws/1-30/patches/0004-EKS-PATCH-Add-instanceExistsGracePeriod-to-cloud-nod.patch @@ -0,0 +1,83 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Carter McKinnon +Date: Wed, 16 Oct 2024 08:48:04 -0700 +Subject: [PATCH] --EKS-PATCH-- Add instanceExistsGracePeriod to + cloud-node-lifecycle-controller + +--- + .../node_lifecycle_controller.go | 38 +++++++++++++++---- + 1 file changed, 31 insertions(+), 7 deletions(-) + +diff --git a/vendor/k8s.io/cloud-provider/controllers/nodelifecycle/node_lifecycle_controller.go b/vendor/k8s.io/cloud-provider/controllers/nodelifecycle/node_lifecycle_controller.go +index b8a50e42cdd..50b0b896478 100644 +--- a/vendor/k8s.io/cloud-provider/controllers/nodelifecycle/node_lifecycle_controller.go ++++ b/vendor/k8s.io/cloud-provider/controllers/nodelifecycle/node_lifecycle_controller.go +@@ -19,9 +19,11 @@ package cloud + import ( + "context" + "errors" ++ "fmt" ++ "os" + "time" + +- "k8s.io/api/core/v1" ++ v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/types" +@@ -65,6 +67,9 @@ type CloudNodeLifecycleController struct { + // check node status posted from kubelet. This value should be lower than nodeMonitorGracePeriod + // set in controller-manager + nodeMonitorPeriod time.Duration ++ ++ // Period of time after Node creation that the controller will assume the corresponding cloud instance exists ++ instanceExistsGracePeriod time.Duration + } + + func NewCloudNodeLifecycleController( +@@ -90,13 +95,26 @@ func NewCloudNodeLifecycleController( + return nil, errors.New("cloud provider does not support instances") + } + ++ var instanceExistsGracePeriod time.Duration ++ instanceExistsGracePeriodFromEnv := os.Getenv("NODE_LIFECYCLE_CONTROLLER_INSTANCE_EXISTS_GRACE_PERIOD") ++ if instanceExistsGracePeriodFromEnv != "" { ++ if period, err := time.ParseDuration(instanceExistsGracePeriodFromEnv); err != nil { ++ return nil, fmt.Errorf("invalid NODE_LIFECYCLE_CONTROLLER_INSTANCE_EXISTS_GRACE_PERIOD: '%s': %v", instanceExistsGracePeriodFromEnv, err) ++ } else { ++ instanceExistsGracePeriod = period ++ } ++ } else { ++ instanceExistsGracePeriod = 2 * time.Minute ++ } ++ + c := &CloudNodeLifecycleController{ +- kubeClient: kubeClient, +- nodeLister: nodeInformer.Lister(), +- broadcaster: eventBroadcaster, +- recorder: recorder, +- cloud: cloud, +- nodeMonitorPeriod: nodeMonitorPeriod, ++ kubeClient: kubeClient, ++ nodeLister: nodeInformer.Lister(), ++ broadcaster: eventBroadcaster, ++ recorder: recorder, ++ cloud: cloud, ++ nodeMonitorPeriod: nodeMonitorPeriod, ++ instanceExistsGracePeriod: instanceExistsGracePeriod, + } + + return c, nil +@@ -150,6 +168,12 @@ func (c *CloudNodeLifecycleController) MonitorNodes(ctx context.Context) { + continue + } + ++ // skip the node if it was recently created, it may not have propagated in cloud provider yet ++ if time.Since(node.CreationTimestamp.Time) < c.instanceExistsGracePeriod { ++ klog.Infof("skipping node %s that was created within grace period (%v)", node.Name, c.instanceExistsGracePeriod) ++ continue ++ } ++ + // At this point the node has NotReady status, we need to check if the node has been removed + // from the cloud provider. If node cannot be found in cloudprovider, then delete the node + exists, err := c.ensureNodeExistsByProviderID(ctx, node) From 526c5c1bceeefefc77cdc6c5414bbd255f58c072 Mon Sep 17 00:00:00 2001 From: Mahesh Kagitha Date: Thu, 24 Oct 2024 17:10:58 -0500 Subject: [PATCH 3/3] Added file release/1-29/production/RELEASE --- release/1-29/production/RELEASE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/1-29/production/RELEASE b/release/1-29/production/RELEASE index 409940768f..a45fd52cc5 100755 --- a/release/1-29/production/RELEASE +++ b/release/1-29/production/RELEASE @@ -1 +1 @@ -23 +24