From bb7d903e1ac7e28d43636246d236eb70982e5601 Mon Sep 17 00:00:00 2001 From: Matt Pryor Date: Wed, 9 Aug 2023 16:42:16 +0100 Subject: [PATCH] Add support for nodeVolumeDetachTimeout and nodeDeletionTimeout (#57) --- .../control-plane/kubeadm-control-plane.yaml | 6 +++--- .../templates/node-group/machine-deployment.yaml | 2 ++ charts/openstack-cluster/values.yaml | 13 ++++++++++++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/charts/openstack-cluster/templates/control-plane/kubeadm-control-plane.yaml b/charts/openstack-cluster/templates/control-plane/kubeadm-control-plane.yaml index 57ee9a2..31fe40a 100644 --- a/charts/openstack-cluster/templates/control-plane/kubeadm-control-plane.yaml +++ b/charts/openstack-cluster/templates/control-plane/kubeadm-control-plane.yaml @@ -87,9 +87,9 @@ spec: apiVersion: infrastructure.cluster.x-k8s.io/v1alpha6 name: {{ include "openstack-cluster.controlplane.mt.name" . }} namespace: {{ .Release.Namespace }} - {{- with .Values.controlPlane.nodeDrainTimeout }} - nodeDrainTimeout: {{ . }} - {{- end }} + nodeDrainTimeout: {{ .Values.controlPlane.nodeDrainTimeout }} + nodeVolumeDetachTimeout: {{ .Values.controlPlane.nodeVolumeDetachTimeout }} + nodeDeletionTimeout: {{ .Values.controlPlane.nodeDeletionTimeout }} kubeadmConfigSpec: {{ include "openstack-cluster.controlplane.kubeadmConfigSpec" diff --git a/charts/openstack-cluster/templates/node-group/machine-deployment.yaml b/charts/openstack-cluster/templates/node-group/machine-deployment.yaml index 7885b34..1a70a62 100644 --- a/charts/openstack-cluster/templates/node-group/machine-deployment.yaml +++ b/charts/openstack-cluster/templates/node-group/machine-deployment.yaml @@ -61,4 +61,6 @@ spec: kind: OpenStackMachineTemplate name: {{ include "openstack-cluster.nodegroup.mt.name" (list $ $nodeGroup) }} nodeDrainTimeout: {{ $nodeGroup.nodeDrainTimeout }} + nodeVolumeDetachTimeout: {{ $nodeGroup.nodeVolumeDetachTimeout }} + nodeDeletionTimeout: {{ $nodeGroup.nodeDeletionTimeout }} {{- end }} diff --git a/charts/openstack-cluster/values.yaml b/charts/openstack-cluster/values.yaml index 4b4342e..cf39836 100644 --- a/charts/openstack-cluster/values.yaml +++ b/charts/openstack-cluster/values.yaml @@ -152,8 +152,12 @@ controlPlane: # availabilityZone: # The time to wait for a node to finish draining before it can be removed nodeDrainTimeout: 5m0s + # The time to wait for a node to detach all volumes before it can be removed + nodeVolumeDetachTimeout: 5m0s + # The time to wait for the node resource to be deleted in Kubernetes when a + # machine is marked for deletion + nodeDeletionTimeout: 5m0s # The rollout strategy to use for the control plane nodes - # By default, the strategy allows the control plane to begin provisioning new nodes # without first tearing down old ones rolloutStrategy: @@ -203,6 +207,8 @@ controlPlane: spec: # By default, unhealthy control plane nodes are always remediated maxUnhealthy: 100% + # If a node takes longer than 10 mins to startup, remediate it + nodeStartupTimeout: 10m0s # By default, consider a control plane node that has not been Ready # for more than 5 mins unhealthy unhealthyConditions: @@ -241,6 +247,11 @@ nodeGroupDefaults: # availabilityZone: # The time to wait for a node to finish draining before it can be removed nodeDrainTimeout: 5m0s + # The time to wait for a node to detach all volumes before it can be removed + nodeVolumeDetachTimeout: 5m0s + # The time to wait for the node resource to be deleted in Kubernetes when a + # machine is marked for deletion + nodeDeletionTimeout: 5m0s # The rollout strategy to use for the node group # By default, this is set to do a rolling update within the existing resource envelope # of the node group, even if that means the node group temporarily has zero nodes