diff --git a/data/data/bootstrap/files/usr/local/bin/bootkube.sh.template b/data/data/bootstrap/files/usr/local/bin/bootkube.sh.template index b0b85af1d72..7513d667cbd 100755 --- a/data/data/bootstrap/files/usr/local/bin/bootkube.sh.template +++ b/data/data/bootstrap/files/usr/local/bin/bootkube.sh.template @@ -402,7 +402,11 @@ run_cluster_bootstrap() { --volume "$PWD:/assets:z" \ --volume /etc/kubernetes:/etc/kubernetes:z \ "${CLUSTER_BOOTSTRAP_IMAGE}" \ - start --tear-down-early=false --asset-dir=/assets --required-pods="${REQUIRED_PODS}" + start \ + --tear-down-early=false \ + --tear-down-delay="{{.TearDownDelay}}" \ + --asset-dir=/assets \ + --required-pods="${REQUIRED_PODS}" } if [ ! -f cb-bootstrap.done ] diff --git a/pkg/asset/ignition/bootstrap/common.go b/pkg/asset/ignition/bootstrap/common.go index 98a2a7f3c41..9a7ac03085a 100644 --- a/pkg/asset/ignition/bootstrap/common.go +++ b/pkg/asset/ignition/bootstrap/common.go @@ -38,6 +38,7 @@ import ( "github.com/openshift/installer/pkg/asset/rhcos" "github.com/openshift/installer/pkg/asset/tls" "github.com/openshift/installer/pkg/types" + "github.com/openshift/installer/pkg/types/alibabacloud" baremetaltypes "github.com/openshift/installer/pkg/types/baremetal" vspheretypes "github.com/openshift/installer/pkg/types/vsphere" ) @@ -78,6 +79,7 @@ type bootstrapTemplateData struct { BootstrapInPlace *types.BootstrapInPlace UseIPv6ForNodeIP bool IsOKD bool + TearDownDelay string } // platformTemplateData is the data to use to replace values in bootstrap @@ -278,6 +280,14 @@ func (a *Common) getTemplateData(dependencies asset.Parents, bootstrapInPlace bo logrus.Warnf("Found override for Cluster Profile: %q", cp) clusterProfile = cp } + + tearDownDelay := "0" + if installConfig.Config.Platform.Name() == alibabacloud.Name { + // tear-down set to let kube-apiserver rolls out and avoid loopback CLB limitation + // BZ https://bugzilla.redhat.com/show_bug.cgi?id=2035757 + tearDownDelay = "10m" + } + var bootstrapInPlaceConfig *types.BootstrapInPlace if bootstrapInPlace { bootstrapInPlaceConfig = installConfig.Config.BootstrapInPlace @@ -297,6 +307,7 @@ func (a *Common) getTemplateData(dependencies asset.Parents, bootstrapInPlace bo BootstrapInPlace: bootstrapInPlaceConfig, UseIPv6ForNodeIP: APIIntVIPonIPv6, IsOKD: installConfig.Config.IsOKD(), + TearDownDelay: tearDownDelay, } }