mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-13 21:34:40 +03:00
doc: modify section order, remove redundant section (#12423)
This commit is contained in:
@@ -2,58 +2,6 @@
|
|||||||
|
|
||||||
Modified from [comments in #3471](https://github.com/kubernetes-sigs/kubespray/issues/3471#issuecomment-530036084)
|
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
|
## Adding/replacing a worker node
|
||||||
|
|
||||||
This should be the easiest.
|
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.
|
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.
|
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
|
||||||
|
|
||||||
### 1) Change control plane nodes order in inventory
|
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:
|
||||||
|
|
||||||
from
|
### 1) Change order of current control planes
|
||||||
|
|
||||||
```ini
|
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:
|
||||||
[kube_control_plane]
|
|
||||||
node-1
|
```yaml
|
||||||
node-2
|
all:
|
||||||
node-3
|
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
|
```yaml
|
||||||
[kube_control_plane]
|
all:
|
||||||
node-2
|
hosts:
|
||||||
node-3
|
children:
|
||||||
node-1
|
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.
|
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.
|
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`
|
`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.
|
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)
|
Update inventory (if needed)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user