Skip to content

Commit

Permalink
modify bootstrap script for 1.31 cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
Kun483 committed Oct 17, 2024
1 parent 7bc27b7 commit c03d1a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
12 changes: 4 additions & 8 deletions bootstrap/kubeadm/internal/cloudinit/kubeadm-bootstrap-script.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2020 The Kubernetes Authors.
# Copyright 2024 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.
Expand Down Expand Up @@ -106,7 +106,6 @@ function retry-command() {
fi
}

# {{ if .ControlPlane }}
function try-or-die-command() {
local kubeadm_return
log::info "running '$*'"
Expand All @@ -118,7 +117,6 @@ function try-or-die-command() {
log::error_exit "fatal error, exiting" "${kubeadm_return}"
fi
}
# {{ end }}

retry-command kubeadm join phase preflight --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests
# {{ if .ControlPlane }}
Expand All @@ -128,10 +126,8 @@ retry-command kubeadm join phase control-plane-prepare kubeconfig
retry-command kubeadm join phase control-plane-prepare control-plane
# {{ end }}
retry-command kubeadm join phase kubelet-start
# {{ if .ControlPlane }}
try-or-die-command kubeadm join phase control-plane-join etcd
retry-command kubeadm join phase control-plane-join update-status
retry-command kubeadm join phase control-plane-join mark-control-plane
# {{ end }}

# Run kubeadm join and skip all already executed phases.
try-or-die-command kubeadm join --skip-phases preflight,control-plane-prepare,kubelet-start

log::success_exit
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope)
DiskSetup: scope.Config.Spec.DiskSetup,
KubeadmVerbosity: verbosityFlag,
UseExperimentalRetry: scope.Config.Spec.UseExperimentalRetryJoin,
KubernetesVersion: parsedVersion,
},
JoinConfiguration: joinData,
}
Expand Down

0 comments on commit c03d1a3

Please sign in to comment.