You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This all-in-one command is a replacement for having to run multiple commands,
while still respecting the version skew policy.
It does the same thing as `kops update cluster --reconcile`:
* Updates the control plane nodes
* Does a rolling update of the control plane nodes
* Updates "normal" nodes and bastion nodes
* Does a rolling update of these nodes
* Prunes old resources that are no longer used
cmd.Flags().StringVar(&options.KubeConfigPath, "kubeconfig", options.KubeConfigPath, "Filename of the kubeconfig to create")
98
92
cmd.Flags().BoolVar(&options.all, "all", options.all, "Export all clusters from the kOps state store")
99
-
cmd.Flags().DurationVar(&options.admin, "admin", options.admin, "Also export a cluster admin user credential with the specified lifetime and add it to the cluster context")
93
+
cmd.Flags().DurationVar(&options.Admin, "admin", options.Admin, "Also export a cluster admin user credential with the specified lifetime and add it to the cluster context")
// cmd.Flags().StringVar(&options.SSHPublicKey, "ssh-public-key", options.SSHPublicKey, "SSH public key to use (deprecated: use kops create secret instead)")
74
+
// cmd.Flags().StringVar(&options.OutDir, "out", options.OutDir, "Path to write any local output")
75
+
// cmd.MarkFlagDirname("out")
76
+
77
+
// These flags from the update command are specified to kubeconfig creation
78
+
//
79
+
// cmd.Flags().BoolVar(&options.CreateKubecfg, "create-kube-config", options.CreateKubecfg, "Will control automatically creating the kube config file on your local filesystem")
80
+
// cmd.Flags().DurationVar(&options.Admin, "admin", options.Admin, "Also export a cluster admin user credential with the specified lifetime and add it to the cluster context")
// cmd.Flags().BoolVar(&options.Internal, "internal", options.Internal, "Use the cluster's internal DNS name. Implies --create-kube-config")
85
+
86
+
cmd.Flags().BoolVar(&options.AllowKopsDowngrade, "allow-kops-downgrade", options.AllowKopsDowngrade, "Allow an older version of kOps to update the cluster than last used")
87
+
88
+
// These flags from the update command are not obviously needed by reconcile, though we can add them if needed:
89
+
//
90
+
// cmd.Flags().StringSliceVar(&options.InstanceGroups, "instance-group", options.InstanceGroups, "Instance groups to update (defaults to all if not specified)")
// cmd.Flags().BoolVar(&options.Prune, "prune", options.Prune, "Delete old revisions of cloud resources that were needed during an upgrade")
105
+
// cmd.Flags().BoolVar(&options.IgnoreKubeletVersionSkew, "ignore-kubelet-version-skew", options.IgnoreKubeletVersionSkew, "Setting this to true will force updating the kubernetes version on all instance groups, regardles of which control plane version is running")
106
+
107
+
// cmd.Flags().BoolVar(&options.Reconcile, "reconcile", options.Reconcile, "Reconcile the cluster by rolling the control plane and nodes sequentially")
108
+
109
+
returncmd
110
+
}
111
+
28
112
// ReconcileCluster updates the cluster to the desired state, including rolling updates where necessary.
29
113
// To respect skew policy, it updates the control plane first, then updates the nodes.
30
114
// "update" is probably now smart enough to automatically not update the control plane if it is already at the desired version,
31
115
// but we do it explicitly here to be clearer / safer.
32
-
funcReconcileCluster(ctx context.Context, f*util.Factory, out io.Writer, c*UpdateClusterOptions) error {
116
+
funcRunReconcileCluster(ctx context.Context, f*util.Factory, out io.Writer, c*CoreUpdateClusterOptions) error {
117
+
if!c.Yes {
118
+
returnfmt.Errorf("reconcile is only supported with --yes")
119
+
}
120
+
ifc.Target==cloudup.TargetTerraform {
121
+
returnfmt.Errorf("reconcile is not supported with terraform")
122
+
}
123
+
33
124
fmt.Fprintf(out, "Updating control plane configuration\n")
0 commit comments