Skip to content

Commit

Permalink
update process
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa6765 committed Jun 13, 2024
1 parent 66b5394 commit 27aa257
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 20 deletions.
89 changes: 89 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,90 @@
# self-managed-k8s-setup (WIP)

# clone project - (control plane and worker node)

```bash
git clone https://github.com/code4mk/self-managed-k8s-setup
```
then change dir `self-managed-k8s-setup`

```bash
cd self-managed-k8s-setup
```

# control plane

1. install k8s (containerd and k8s)

```bash
./k8s-setup.sh
```

2. then check kubelet status

```bash
./kubelet-status.sh
```

if status is good go to next step (3) if faces error again run install k8s step (1)

3. control-plane setup

```bash
./control-plane-setup.sh
```

4. cni setup

before cni setup need to setup your worker node and worker node join with control plane

* this script setup flannel cni

```bash
./contorl-plane-cni-setup
```

```bash
kubectl get nodes
kubectl get pods -A -o wide
kubectl get svc -A -o wide
```

# Worker node setup

1. install k8s (containerd and k8s)

```bash
./k8s-setup.sh
```

2. then check kubelet status

```bash
./kubelet-status.sh
```

if status is good go to next step (3) if faces error again run install k8s step (1)

3. join with control plane

you can manually join

```bash
sudo your_token
```

or

```bash
./worker-node-setup.sh
```


# connect with lens

```bash
cd ~
cat .kube/config
```

then copy the cat output and that will submit with lens ( join with kube config)
4 changes: 0 additions & 4 deletions common/k8s-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,3 @@ sudo systemctl enable --now kubelet
# Check kubeadm version
print_green "Checking kubeadm version..."
kubeadm version

# Check kubelet service status
print_green "Checking kubelet service status..."
sudo systemctl status kubelet
8 changes: 0 additions & 8 deletions control-plane-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ if [[ -z "$pod_network_cidr" ]]; then
exit 1
fi

# Run containerd installation
print_green "Running containerd installation..."
./common/containerd-install.sh

# Run Kubernetes installation
print_green "Running Kubernetes installation..."
./common/k8s-install.sh

# Fetch the private IP address of the VM
private_ip=$(hostname -I | awk '{print $1}')

Expand Down
7 changes: 7 additions & 0 deletions k8s-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Run containerd installation
print_green "Running containerd installation..."
./common/containerd-install.sh

# Run Kubernetes installation
print_green "Running Kubernetes installation..."
./common/k8s-install.sh
Empty file added kubelet-status.sh
Empty file.
8 changes: 0 additions & 8 deletions worker-node-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ print_green() {
# Exit on any error
set -e

# Run containerd installation
print_green "Running containerd installation..."
./common/containerd-install.sh

# Run Kubernetes installation
print_green "Running Kubernetes installation..."
./common/k8s-install.sh

# Prompt user for the full join command
read -p "Enter the full join command to join the worker node to the Kubernetes cluster: " join_command

Expand Down

0 comments on commit 27aa257

Please sign in to comment.