Skip to content

Commit

Permalink
Add cluster configuration files for Superclusters 01, 02, and 03; upd…
Browse files Browse the repository at this point in the history
…ate README with new documentation link
  • Loading branch information
EliasDeHondt committed Dec 21, 2024
1 parent 4bd6419 commit 83d5a44
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
![logo](https://eliasdh.com/assets/media/images/logo-github.png)
# 💙🤍Create HA K8s Cluster🤍💙
# 💙🤍Setup Supercluster🤍💙

## 📘Table of Contents

Expand All @@ -11,8 +11,7 @@
3. [👉Step 3: Install and Configure Kubernetes](#👉step-3-install-and-configure-kubernetes)
4. [👉Step 4: Set up reverse/forward proxy](#👉step-4-set-up-reverseforward-proxy)
5. [👉Step 5: Initialize the Kubernetes cluster](#👉step-5-initialize-the-kubernetes-cluster)
4. [📝Notes](#📝notes)
5. [🔗Links](#🔗links)
4. [🔗Links](#🔗links)

---

Expand Down Expand Up @@ -438,20 +437,28 @@ sudo ./get_helm.sh
```bash
# Install the Cilium CLI
helm repo add cilium https://helm.cilium.io/

# Set the Cilium CLI version
CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable.txt)

# Set the Cilium CLI architecture
CLI_ARCH=amd64

# Check the architecture
if [ "$(uname -m)" = "aarch64" ]; then CLI_ARCH=arm64; fi

# Download the Cilium CLI
curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}

# Verify the Cilium CLI
sha256sum --check cilium-linux-${CLI_ARCH}.tar.gz.sha256sum

# Extract the Cilium CLI
sudo tar xzvfC cilium-linux-${CLI_ARCH}.tar.gz /usr/local/bin

# Remove the Cilium CLI
rm cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}

# Install the Cilium Helm chart
helm install cilium cilium/cilium --version 1.16.1 \
--namespace kube-system \
Expand All @@ -473,39 +480,6 @@ watch kubectl get pods -n kube-system # Press Ctrl+C to exit
watch kubectl get nodes -o wide # Press Ctrl+C to exit
```

***Congratulations, you have your high availability cluster up and running!***

## 📝Notes

- Interesting commands:
```bash
sudo crictl --runtime-endpoint unix:///run/containerd/containerd.sock ps -a # List all containers

sudo crictl --runtime-endpoint unix:///run/containerd/containerd.sock logs 494942b3f2efb # Get the logs of a container

sudo kubeadm init --cri-socket "/run/containerd/containerd.sock" --pod-network-cidr "10.244.0.0/16" --cluster-name "cluster01" --upload-certs --v=5 # Initialize the cluster without high availability no ip of the reverse proxy for the control plane endpoint

sudo ufw disable # Disable the firewall
sudo ufw enable # Enable the firewall
sudo ufw allow 22/tcp # Allow SSH

sudo kubeadm reset # Reset the cluster (remove the nodes from the cluster)

kubectl get nodes -o wide # List all nodes with additional information


sudo cat /etc/kubernetes/manifests/kube-apiserver.yaml # Check the API server configuration

sudo tail -f /var/log/nginx/access.log # Check the Nginx access log
sudo tail -f /var/log/nginx/error.log # Check the Nginx error log

sudo apt-get remove -y nginx nginx-common nginx-core # Remove Nginx
sudo apt-get purge -y nginx nginx-common nginx-core # Purge Nginx
sudo apt-get autoremove -y # Remove unused packages

sudo rm -rf $HOME/.kube/config # Remove the Kubernetes configuration
```

## 🔗Links
- 👯 Web hosting company [EliasDH.com](https://eliasdh.com).
- 📫 How to reach us elias.dehondt@outlook.com
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Please also see following documents:

## 📚Documentation

- [Setup-Supercluster.md](/Documentation/Setup-Supercluster.md)
- [Cert-manager-and-nginx-ingress.md](/Documentation/Cert-manager-and-nginx-ingress.md)
- [Create-HA-K8s-Cluster.md](/Documentation/Create-HA-K8s-Cluster.md)
- [Install-K9s-Tool.md](/Documentation/Install-K9s-Tool.md)
Expand Down
15 changes: 15 additions & 0 deletions Supercluster/Cluster01/ClusterConfiguration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
############################
# @author Elias De Hondt #
# @see https://eliasdh.com #
# @since 24/11/2024 #
############################
---
apiVersion: v1
kind: ClusterConfiguration
metadata:
name: cluster01
controlPlaneEndpoint: "192.168.1.170:6443"
networking:
podSubnet: "10.244.0.0/16"
criSocket: "/run/containerd/containerd.sock"
---
15 changes: 15 additions & 0 deletions Supercluster/Cluster02/ClusterConfiguration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
############################
# @author Elias De Hondt #
# @see https://eliasdh.com #
# @since 24/11/2024 #
############################
---
apiVersion: v1
kind: ClusterConfiguration
metadata:
name: cluster02
controlPlaneEndpoint: "192.168.1.170:6443"
networking:
podSubnet: "10.244.0.0/16"
criSocket: "/run/containerd/containerd.sock"
---
15 changes: 15 additions & 0 deletions Supercluster/Cluster03/ClusterConfiguration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
############################
# @author Elias De Hondt #
# @see https://eliasdh.com #
# @since 24/11/2024 #
############################
---
apiVersion: v1
kind: ClusterConfiguration
metadata:
name: cluster03
controlPlaneEndpoint: "192.168.1.170:6443"
networking:
podSubnet: "10.244.0.0/16"
criSocket: "/run/containerd/containerd.sock"
---

0 comments on commit 83d5a44

Please sign in to comment.