mirror of
https://github.com/khuedoan/homelab.git
synced 2024-12-23 01:24:36 +07:00
docs(tutorials): how to scale vertically
This commit is contained in:
parent
01712883fa
commit
056e9061a6
@ -12,7 +12,7 @@
|
||||
- [Troubleshooting](./troubleshooting.md)
|
||||
- [Tutorials]()
|
||||
- [Single node cluster adjustments](./tutorials/single_node_cluster_adjustments.md)
|
||||
- [Add or remove nodes (scale up or down)]()
|
||||
- [Add or remove nodes (scale up or down)](./tutorials/add-or-remove-nodes.md)
|
||||
- [Install new applications]()
|
||||
- [Reference](./reference/README.md)
|
||||
- [Architecture](./reference/architecture.md)
|
||||
|
68
docs/src/tutorials/add-or-remove-nodes.md
Normal file
68
docs/src/tutorials/add-or-remove-nodes.md
Normal file
@ -0,0 +1,68 @@
|
||||
# Add or remove nodes
|
||||
|
||||
Or how to scale vertically. To replace the same node with a clean OS, remove it and add it again.
|
||||
|
||||
## Add new nodes
|
||||
|
||||
> You can add multiple nodes at the same time
|
||||
|
||||
Ensure that it meets the requirements in [prerequisites](../deployment/prerequisites.md), then add its details to the inventory:
|
||||
|
||||
```diff
|
||||
diff --git a/metal/inventories/prod.yml b/metal/inventories/prod.yml
|
||||
index 7f6474a..1bb2cbc 100644
|
||||
--- a/metal/inventories/prod.yml
|
||||
+++ b/metal/inventories/prod.yml
|
||||
@@ -8,3 +8,4 @@ metal:
|
||||
workers:
|
||||
hosts:
|
||||
metal3: {ansible_host: 192.168.1.113, mac: '00:23:24:d1:f5:69', disk: sda, network_interface: eno1}
|
||||
+ metal4: {ansible_host: 192.168.1.114, mac: '00:11:22:33:44:55', disk: sda, network_interface: eno1}
|
||||
```
|
||||
|
||||
Install the OS and join the cluster:
|
||||
|
||||
```
|
||||
make metal
|
||||
```
|
||||
|
||||
That's it!
|
||||
|
||||
## Remove a node
|
||||
|
||||
> It is recommended to remove nodes one at a time
|
||||
|
||||
Remove it from the inventory:
|
||||
|
||||
```diff
|
||||
diff --git a/metal/inventories/prod.yml b/metal/inventories/prod.yml
|
||||
index 7f6474a..d12b50a 100644
|
||||
--- a/metal/inventories/prod.yml
|
||||
+++ b/metal/inventories/prod.yml
|
||||
@@ -4,7 +4,6 @@ metal:
|
||||
hosts:
|
||||
metal0: {ansible_host: 192.168.1.110, mac: '00:23:24:d1:f3:f0', disk: sda, network_interface: eno1}
|
||||
metal1: {ansible_host: 192.168.1.111, mac: '00:23:24:d1:f4:d6', disk: sda, network_interface: eno1}
|
||||
- metal2: {ansible_host: 192.168.1.112, mac: '00:23:24:e7:04:60', disk: sda, network_interface: eno1}
|
||||
workers:
|
||||
hosts:
|
||||
metal3: {ansible_host: 192.168.1.113, mac: '00:23:24:d1:f5:69', disk: sda, network_interface: eno1}
|
||||
```
|
||||
|
||||
Drain the node:
|
||||
|
||||
```sh
|
||||
kubectl drain ${NODE_NAME} --delete-emptydir-data --ignore-daemonsets --force
|
||||
```
|
||||
|
||||
Remove the node from the cluster
|
||||
|
||||
```sh
|
||||
kubectl delete node ${NODE_NAME}
|
||||
```
|
||||
|
||||
Shutdown the node:
|
||||
|
||||
```
|
||||
ssh root@${NODE_IP} poweroff
|
||||
```
|
Loading…
Reference in New Issue
Block a user