Skip to content

Commit

Permalink
docs(tutorials): how to scale vertically
Browse files Browse the repository at this point in the history
  • Loading branch information
khuedoan committed Feb 13, 2022
1 parent 0171288 commit 056e906
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
68 changes: 68 additions & 0 deletions docs/src/tutorials/add-or-remove-nodes.md
Original file line number Diff line number Diff line change
@@ -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
```

0 comments on commit 056e906

Please sign in to comment.