Skip to content

Commit 7fd1410

Browse files
committed
Updated node join script
1 parent 41c8459 commit 7fd1410

File tree

3 files changed

+11
-29
lines changed

3 files changed

+11
-29
lines changed

README.md

+2-10
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ Setup the control-plane by running:
2828
sudo bash control-plane.sh
2929
```
3030

31-
Copy the generated configuration `config/kubeadm-join.yaml` to each worker node and run this command to join the cluster:
31+
Copy the generated configuration files `config/kubeadm-join.<node-type>.yaml` to each node and run this command to join the cluster:
3232
```bash
33-
sudo bash worker.sh
33+
sudo bash node.sh 'config/kubeadm-join.<node-type>.yaml'
3434
```
3535

3636
Run this on the control-plane for bootstrapping the [infrastructure](https://github.com/mmontes11/k8s-infrastructure):
@@ -43,14 +43,6 @@ export GITHUB_TOKEN=<your-personal-access-token>
4343
./bootstrap.sh
4444
```
4545

46-
### Label nodes
47-
48-
In order to label nodes, run the following script in the control-plane:
49-
50-
```bash
51-
./label-nodes.sh
52-
```
53-
5446
### Kubeconfig
5547

5648
`admin` and `super-admin` kubeconfigs are available in the following control-plane paths:

label-nodes.sh

-13
This file was deleted.

worker.sh node.sh

+9-6
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,29 @@ set -euo pipefail
44

55
source ./scripts/lib.sh
66

7-
JOIN_CONFIG_FILE=config/kubeadm-join.yaml
7+
if [ $# -lt 1 ]; then
8+
echo "Usage: $0 <join-config-file>"
9+
exit 1
10+
fi
811

12+
JOIN_CONFIG_FILE="$1"
913
if [ ! -f $JOIN_CONFIG_FILE ]; then
1014
echo "Join configuration file '$JOIN_CONFIG_FILE' not found"
1115
exit 1
1216
fi
1317

14-
install_scripts=(
18+
INSTALL_SCRIPTS=(
1519
"scripts/apt.sh"
1620
"scripts/swap.sh"
1721
"scripts/network.sh"
1822
"scripts/storage.sh"
1923
"scripts/containerd.sh"
2024
"scripts/kubernetes.sh"
2125
)
22-
23-
for i in "${!install_scripts[@]}"; do
24-
source "${install_scripts[$i]}"
26+
for INSTALL in "${INSTALL_SCRIPTS[@]}"; do
27+
source "$INSTALL"
2528
done
2629

2730
kubeadm join --config $JOIN_CONFIG_FILE
2831

29-
echo "worker installation completed successfully! 🚜"
32+
echo "node installation completed successfully! 🚜"

0 commit comments

Comments
 (0)