Skip to content

Commit 27aa257

Browse files
committed
update process
1 parent 66b5394 commit 27aa257

File tree

6 files changed

+96
-20
lines changed

6 files changed

+96
-20
lines changed

README.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,90 @@
11
# self-managed-k8s-setup (WIP)
2+
3+
# clone project - (control plane and worker node)
4+
5+
```bash
6+
git clone https://github.com/code4mk/self-managed-k8s-setup
7+
```
8+
then change dir `self-managed-k8s-setup`
9+
10+
```bash
11+
cd self-managed-k8s-setup
12+
```
13+
14+
# control plane
15+
16+
1. install k8s (containerd and k8s)
17+
18+
```bash
19+
./k8s-setup.sh
20+
```
21+
22+
2. then check kubelet status
23+
24+
```bash
25+
./kubelet-status.sh
26+
```
27+
28+
if status is good go to next step (3) if faces error again run install k8s step (1)
29+
30+
3. control-plane setup
31+
32+
```bash
33+
./control-plane-setup.sh
34+
```
35+
36+
4. cni setup
37+
38+
before cni setup need to setup your worker node and worker node join with control plane
39+
40+
* this script setup flannel cni
41+
42+
```bash
43+
./contorl-plane-cni-setup
44+
```
45+
46+
```bash
47+
kubectl get nodes
48+
kubectl get pods -A -o wide
49+
kubectl get svc -A -o wide
50+
```
51+
52+
# Worker node setup
53+
54+
1. install k8s (containerd and k8s)
55+
56+
```bash
57+
./k8s-setup.sh
58+
```
59+
60+
2. then check kubelet status
61+
62+
```bash
63+
./kubelet-status.sh
64+
```
65+
66+
if status is good go to next step (3) if faces error again run install k8s step (1)
67+
68+
3. join with control plane
69+
70+
you can manually join
71+
72+
```bash
73+
sudo your_token
74+
```
75+
76+
or
77+
78+
```bash
79+
./worker-node-setup.sh
80+
```
81+
82+
83+
# connect with lens
84+
85+
```bash
86+
cd ~
87+
cat .kube/config
88+
```
89+
90+
then copy the cat output and that will submit with lens ( join with kube config)

common/k8s-install.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,3 @@ sudo systemctl enable --now kubelet
4848
# Check kubeadm version
4949
print_green "Checking kubeadm version..."
5050
kubeadm version
51-
52-
# Check kubelet service status
53-
print_green "Checking kubelet service status..."
54-
sudo systemctl status kubelet

control-plane-setup.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ if [[ -z "$pod_network_cidr" ]]; then
2424
exit 1
2525
fi
2626

27-
# Run containerd installation
28-
print_green "Running containerd installation..."
29-
./common/containerd-install.sh
30-
31-
# Run Kubernetes installation
32-
print_green "Running Kubernetes installation..."
33-
./common/k8s-install.sh
34-
3527
# Fetch the private IP address of the VM
3628
private_ip=$(hostname -I | awk '{print $1}')
3729

k8s-setup.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Run containerd installation
2+
print_green "Running containerd installation..."
3+
./common/containerd-install.sh
4+
5+
# Run Kubernetes installation
6+
print_green "Running Kubernetes installation..."
7+
./common/k8s-install.sh

kubelet-status.sh

Whitespace-only changes.

worker-node-setup.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@ print_green() {
88
# Exit on any error
99
set -e
1010

11-
# Run containerd installation
12-
print_green "Running containerd installation..."
13-
./common/containerd-install.sh
14-
15-
# Run Kubernetes installation
16-
print_green "Running Kubernetes installation..."
17-
./common/k8s-install.sh
18-
1911
# Prompt user for the full join command
2012
read -p "Enter the full join command to join the worker node to the Kubernetes cluster: " join_command
2113

0 commit comments

Comments
 (0)