Skip to content

Commit b5b9674

Browse files
committed
[Doc] Added script to join worker nodes. Elaborated control plane init script and cni installation.
Signed-off-by: insukim1994 <insu.kim@moreh.io>
1 parent 0aeea8f commit b5b9674

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

utils/create-kubernetes-controlplane-node.sh renamed to utils/init-kubernetes-controlplane-node.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,7 @@ sudo kubeadm init --cri-socket=unix:///var/run/crio/crio.sock
3434
# kubeadm join <YOUR_CONTROL_PLANE_NODE_IP> --token <YOUR_GENERATED_TOKEN> \
3535
# --discovery-token-ca-cert-hash <YOUR_GENERATED_CA_CERT_HASH>
3636
# --------------------------------------------------------------------------------
37+
38+
# Make sure to save the following command from your output:
39+
# sudo kubeadm join <YOUR_CONTROL_PLANE_NODE_IP> --token <YOUR_GENERATED_TOKEN> \
40+
# --discovery-token-ca-cert-hash <YOUR_GENERATED_CA_CERT_HASH> --cri-socket=unix:///var/run/crio/crio.sock

utils/install-cri-o.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/bash
22

33
# Refer to https://github.com/cri-o/packaging/blob/main/README.md#distributions-using-deb-packages
4+
# and
5+
# https://github.com/cri-o/cri-o/blob/main/contrib/cni/README.md#configuration-directory
46
# for more information.
57

68
# Install the dependencies for adding repositories
@@ -22,3 +24,7 @@ sudo apt-get install -y cri-o
2224

2325
# Start CRI-O
2426
sudo systemctl start crio.service
27+
28+
# Install CNI (container network interface) plugins
29+
wget https://raw.githubusercontent.com/cri-o/cri-o/refs/heads/main/contrib/cni/10-crio-bridge.conflist
30+
sudo cp 10-crio-bridge.conflist /etc/cni/net.d
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
# You got following output from previous control node initialization:
4+
5+
# --------------------------------------------------------------------------------
6+
# Your Kubernetes control-plane has initialized successfully!
7+
#
8+
# ...
9+
#
10+
# Then you can join any number of worker nodes by running the following on each as root:
11+
#
12+
# kubeadm join <YOUR_CONTROL_PLANE_NODE_IP> --token <YOUR_GENERATED_TOKEN> \
13+
# --discovery-token-ca-cert-hash sha256:<YOUR_GENERATED_CA_CERT_HASH>
14+
# --------------------------------------------------------------------------------
15+
16+
# Make sure to execute the following command on your worker node:
17+
sudo kubeadm join <YOUR_CONTROL_PLANE_NODE_IP> --token <YOUR_GENERATED_TOKEN> \
18+
--discovery-token-ca-cert-hash sha256:<YOUR_GENERATED_CA_CERT_HASH> --cri-socket=unix:///var/run/crio/crio.sock
19+
20+
# If you lost above information, you can get the token and hash by running following command on your CONTROL PLANE node:
21+
# To get <YOUR_CONTROL_PLANE_NODE_IP>
22+
kubectl get nodes -o wide | grep -i control-plane | awk '{printf $6}'
23+
24+
# To get <YOUR_GENERATED_TOKEN>
25+
sudo kubeadm token create
26+
27+
# To get <YOUR_GENERATED_CA_CERT_HASH>
28+
openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | \
29+
openssl rsa -pubin -outform der 2>/dev/null | \
30+
sha256sum | awk '{print $1}'

0 commit comments

Comments
 (0)