diff --git a/docs/operations/nodes.md b/docs/operations/nodes.md index b9cef8df5..1c21d6c46 100644 --- a/docs/operations/nodes.md +++ b/docs/operations/nodes.md @@ -2,58 +2,6 @@ Modified from [comments in #3471](https://github.com/kubernetes-sigs/kubespray/issues/3471#issuecomment-530036084) -## Limitation: Removal of first kube_control_plane and etcd-master - -Currently you can't remove the first node in your kube_control_plane and etcd-master list. If you still want to remove this node you have to: - -### 1) Change order of current control planes - -Modify the order of your control plane list by pushing your first entry to any other position. E.g. if you want to remove `node-1` of the following example: - -```yaml - children: - kube_control_plane: - hosts: - node-1: - node-2: - node-3: - kube_node: - hosts: - node-1: - node-2: - node-3: - etcd: - hosts: - node-1: - node-2: - node-3: -``` - -change your inventory to: - -```yaml - children: - kube_control_plane: - hosts: - node-2: - node-3: - node-1: - kube_node: - hosts: - node-2: - node-3: - node-1: - etcd: - hosts: - node-2: - node-3: - node-1: -``` - -## 2) Upgrade the cluster - -run `upgrade-cluster.yml` or `cluster.yml`. Now you are good to go on with the removal. - ## Adding/replacing a worker node This should be the easiest. @@ -100,40 +48,74 @@ crictl ps | grep nginx-proxy | awk '{print $1}' | xargs crictl stop With the old node still in the inventory, run `remove-node.yml`. You need to pass `-e node=NODE_NAME` to the playbook to limit the execution to the node being removed. If the node you want to remove is not online, you should add `reset_nodes=false` and `allow_ungraceful_removal=true` to your extra-vars. -## Replacing a first control plane node +## Adding/Removal of first `kube_control_plane` and etcd-master + +Currently you can't remove the first node in your `kube_control_plane` and etcd-master list. If you still want to remove this node you have to: -### 1) Change control plane nodes order in inventory +### 1) Change order of current control planes -from +Modify the order of your control plane list by pushing your first entry to any other position. E.g. if you want to remove `node-1` of the following example: -```ini -[kube_control_plane] - node-1 - node-2 - node-3 +```yaml +all: + hosts: + children: + kube_control_plane: + hosts: + node-1: + node-2: + node-3: + kube_node: + hosts: + node-1: + node-2: + node-3: + etcd: + hosts: + node-1: + node-2: + node-3: ``` -to +change your inventory to: -```ini -[kube_control_plane] - node-2 - node-3 - node-1 +```yaml +all: + hosts: + children: + kube_control_plane: + hosts: + node-2: + node-3: + node-1: + kube_node: + hosts: + node-2: + node-3: + node-1: + etcd: + hosts: + node-2: + node-3: + node-1: ``` -### 2) Remove old first control plane node from cluster +### 2) Upgrade the cluster + +run `upgrade-cluster.yml` or `cluster.yml`. Now you are good to go on with the removal. + +### 3) Remove old first control plane node from cluster With the old node still in the inventory, run `remove-node.yml`. You need to pass `-e node=node-1` to the playbook to limit the execution to the node being removed. If the node you want to remove is not online, you should add `reset_nodes=false` and `allow_ungraceful_removal=true` to your extra-vars. -### 3) Edit cluster-info configmap in kube-public namespace +### 4) Edit cluster-info configmap in kube-public namespace `kubectl edit cm -n kube-public cluster-info` Change ip of old kube_control_plane node with ip of live kube_control_plane node (`server` field). Also, update `certificate-authority-data` field if you changed certs. -### 4) Add new control plane node +### 5) Add new control plane node Update inventory (if needed)