cli/cmd/cluster: allow to skip the control plane update
When the cluster is not fully set up and lokoctl is run again to fix that
problem, the user may want to avoid the control plane update happen at the
same time, because it can cause issues.
MODIFY
cli/cmd/cluster-apply.go
cli/cmd/cluster-apply.go
@@ -26,6 +26,7 @@ var (
verbose bool
skipComponents bool
skipPreUpdateHealthCheck bool
+ skipControlPlaneUpdate bool
upgradeKubelets bool
)
@@ -47,6 +48,8 @@ func init() {
pf.BoolVarP(&skipPreUpdateHealthCheck, "skip-pre-update-health-check", "", false,
"Skip ensuring that cluster is healthy before updating (not recommended)")
+ pf.BoolVarP(&skipControlPlaneUpdate, "skip-control-plane-update", "", false,
+ "Skip updating the control plane (not recommended)")
pf.BoolVarP(&upgradeKubelets, "upgrade-kubelets", "", false, "Experimentally upgrade self-hosted kubelets")
}
@@ -62,6 +65,7 @@ func runClusterApply(cmd *cobra.Command, args []string) {
UpgradeKubelets: upgradeKubelets,
SkipComponents: skipComponents,
SkipPreUpdateHealthCheck: skipPreUpdateHealthCheck,
+ SkipControlPlaneUpdate: skipControlPlaneUpdate,
Verbose: verbose,
ConfigPath: viper.GetString("lokocfg"),
ValuesPath: viper.GetString("lokocfg-vars"),

MODIFY
cli/cmd/cluster/apply.go
cli/cmd/cluster/apply.go
@@ -31,6 +31,7 @@ type ApplyOptions struct {
UpgradeKubelets bool
SkipComponents bool
SkipPreUpdateHealthCheck bool
+ SkipControlPlaneUpdate bool
Verbose bool
ConfigPath string
ValuesPath string
@@ -126,7 +127,7 @@ func Apply(contextLogger *log.Entry, options ApplyOptions) error {
}
// Do controlplane upgrades only if cluster already exists and it is not a managed platform.
- if exists && !c.platform.Meta().Managed {
+ if exists && !options.SkipControlPlaneUpdate && !c.platform.Meta().Managed {
fmt.Printf("\nEnsuring that cluster controlplane is up to date.\n")
if err := c.upgradeControlPlane(contextLogger, kubeconfig); err != nil {

cli/cmd/cluster: allow to skip the control plane update

When the cluster is not fully set up and lokoctl is run again to fix that
problem, the user may want to avoid the control plane update happen at the
same time, because it can cause issues.