Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1482 from kinvolk/imran/allow-skip-control-plane-…
Browse files Browse the repository at this point in the history
…update

cli/cmd/cluster: allow to skip the control plane update
  • Loading branch information
ipochi authored Jun 8, 2021
2 parents 7a2f25a + 955edbe commit c1f853e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cli/cmd/cluster-apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ var (
verbose bool
skipComponents bool
skipPreUpdateHealthCheck bool
skipControlPlaneUpdate bool
upgradeKubelets bool
)

Expand All @@ -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")
}
Expand All @@ -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"),
Expand Down
3 changes: 2 additions & 1 deletion cli/cmd/cluster/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type ApplyOptions struct {
UpgradeKubelets bool
SkipComponents bool
SkipPreUpdateHealthCheck bool
SkipControlPlaneUpdate bool
Verbose bool
ConfigPath string
ValuesPath string
Expand Down Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions docs/cli/lokoctl_cluster_apply.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ lokoctl cluster apply [flags]
--confirm Upgrade cluster without asking for confirmation
-h, --help help for apply
--skip-components Skip applying component configuration
--skip-control-plane-update Skip updating the control plane (not recommended)
--skip-pre-update-health-check Skip ensuring that cluster is healthy before updating (not recommended)
--upgrade-kubelets Experimentally upgrade self-hosted kubelets
-v, --verbose Show output from Terraform
Expand Down

0 comments on commit c1f853e

Please sign in to comment.