Skip to content

Commit 0102494

Browse files
authored
Merge pull request #17191 from rifelpet/reconcile-docs
Add docs for the new kops reconcile cluster command
2 parents f26ddf8 + 863d7a8 commit 0102494

File tree

3 files changed

+61
-7
lines changed

3 files changed

+61
-7
lines changed

docs/operations/updates_and_upgrades.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,14 @@ It is recommended to run the latest version of kOps to ensure compatibility with
6262
In future the upgrade step will likely perform the update immediately (and possibly even without a
6363
node restart), but currently you must:
6464

65+
For kOps 1.31 and newer, run `kops reconcile cluster $NAME --yes`
66+
67+
For older kOps versions, run:
6568
* `kops update cluster $NAME` to preview, then `kops update cluster $NAME --yes`
6669
* `kops rolling-update cluster $NAME` to preview, then `kops rolling-update cluster $NAME --yes`
6770

71+
For more detail about the command change in kOps 1.31, see [docs/tutorial/upgrading-kubernetes.md](/docs/tutorial/upgrading-kubernetes.md).
72+
6873
Upgrade uses the latest Kubernetes version considered stable by kOps, defined in `https://github.com/kubernetes/kops/blob/master/channels/stable`.
6974

7075

docs/releases/1.31-NOTES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ This is a document to gather the release notes prior to the release.
66

77
# Significant changes
88

9+
* **Kubernetes minor version upgrades to 1.31 *must* be performed using a new `kops reconcile cluster` command.**
10+
11+
See [docs/tutorial/upgrading-kubernetes.md](/docs/tutorial/upgrading-kubernetes.md) for more details.
12+
913
## Some Feature
1014

1115
Lorem ipsum....

docs/tutorial/upgrading-kubernetes.md

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,60 @@
11
# Upgrading kubernetes
22

3+
## **NOTE for Kubernetes >1.31**
4+
5+
Kops' upgrade procedure has historically risked violating the [Kubelet version skew policy](https://kubernetes.io/releases/version-skew-policy/#kubelet). After `kops update cluster --yes` completes and before every kube-apiserver is replaced with `kops rolling-update cluster --yes`, newly launched nodes running newer kubelet versions could be connecting to older `kube-apiserver` nodes.
6+
7+
**Violating this policy when upgrading to Kubernetes 1.31 can cause newer kubelets to crash.** [This kubernetes issue](https://github.com/kubernetes/kubernetes/issues/127316) provides details though it was not addressed because the change does not actually violate the version skew policy, it merely breaks tooling that was already violating the policy.
8+
9+
To upgrade a cluster to Kubernetes 1.31 or newer, use the new `kops reconcile cluster` command introduced in Kops 1.31. This replaces both `kops update cluster --yes` and `kops rolling-update cluster --yes`.
10+
11+
`kops reconcile cluster` will interleave the cloud provider updates of `kops update cluster --yes` with the node rotations of `kops rolling-update cluster --yes`.
12+
13+
It is comparable to the following sequence:
14+
1. `kops update cluster --instance-group-roles=control-plane,apiserver --yes`
15+
2. `kops rolling-update cluster --instance-group-roles=control-plane,apiserver --yes`
16+
3. `kops update cluster --yes`
17+
4. `kops rolling-update cluster --yes`
18+
5. `kops update cluster --prune --yes`
19+
20+
**Terraform** users will need to use a targeted terraform apply with the normal `kops rolling-update cluster --yes`:
21+
22+
```sh
23+
$ kops update cluster --target terraform ...
24+
25+
# Get the terraform resource IDs of the instance groups with a spec.role of `ControlPlane`, `Master`, or `APIServer`
26+
# The exact output may vary.
27+
$ terraform state list | grep -E 'aws_autoscaling_group|google_compute_instance_group_manager|hcloud_server|digitalocean_droplet|scaleway_instance_server'
28+
aws_autoscaling_group.controlplane-us-east-1a-example-com
29+
aws_autoscaling_group.controlplane-us-east-1b-example-com
30+
aws_autoscaling_group.controlplane-us-east-1c-example-com
31+
aws_autoscaling_group.nodes-example-com
32+
aws_autoscaling_group.bastion-example-com
33+
34+
# Apply the changes to all control plane instance groups
35+
$ terraform apply -target 'aws_autoscaling_group.controlplane-us-east-1a-example-com' -target 'aws_autoscaling_group.controlplane-us-east-1b-example-com' -target 'aws_autoscaling_group.controlplane-us-east-1c-example-com'
36+
37+
# Roll the apiserver nodes
38+
$ kops rolling-update cluster --yes --instance-group-roles control-plane,apiserver
39+
40+
# Apply everything else
41+
$ terraform apply
42+
43+
# Roll the remaining nodes
44+
$ kops rolling-update cluster --yes
45+
```
46+
47+
## Upgrades before Kops 1.31
48+
349
Upgrading kubernetes is very easy with kOps, as long as you are using a compatible version of kOps.
4-
The kOps `1.18.x` series (for example) supports the kubernetes 1.16, 1.17 and 1.18 series,
50+
The kOps `1.30.x` series (for example) supports the kubernetes 1.28, 1.29, and 1.30 series,
551
as per the kubernetes deprecation policy. Older versions of kubernetes will likely still work, but these
6-
are on a best-effort basis and will have little if any testing. kOps `1.18` will not support the kubernetes
7-
`1.19` series, and for full support of kubernetes `1.19` it is best to wait for the kOps `1.19` series release.
8-
We aim to release the next major version of kOps within a few weeks of the equivalent major release of kubernetes,
9-
so kOps `1.19.0` will be released within a few weeks of kubernetes `1.19.0`. We try to ensure that a 1.19 pre-release
10-
(alpha or beta) is available at the kubernetes release, for early adopters.
52+
are on a best-effort basis and will have little if any testing. kOps `1.30` will not support the kubernetes
53+
`1.31` series, and for full support of kubernetes `1.31` it is best to wait for the kOps `1.31` series release.
54+
We aim to release the next major version of kOps within a few weeks of the equivalent major release of kubernetes.
55+
We try to ensure that a pre-release (alpha or beta) is available at the kubernetes release date, for early adopters.
1156

12-
Upgrading kubernetes is similar to changing the image on an InstanceGroup, except that the kubernetes version is
57+
Upgrading kubernetes is similar to changing the image on an InstanceGroup, the kubernetes version is
1358
controlled at the cluster level. So instead of `kops edit ig <name>`, we `kops edit cluster`, and change the
1459
`kubernetesVersion` field. `kops edit cluster` will open your editor with the cluster, similar to:
1560

0 commit comments

Comments
 (0)