diff --git a/k3s-homelab-full/Makefile b/Makefile similarity index 100% rename from k3s-homelab-full/Makefile rename to Makefile diff --git a/k3s-homelab-full/bootstrap.sh b/bootstrap.sh similarity index 100% rename from k3s-homelab-full/bootstrap.sh rename to bootstrap.sh diff --git a/ced-k3s-homelab-full.zip b/ced-k3s-homelab-full.zip deleted file mode 100644 index 49a5997..0000000 Binary files a/ced-k3s-homelab-full.zip and /dev/null differ diff --git a/k3s-homelab-full/cluster-setup.md b/cluster-setup.md similarity index 76% rename from k3s-homelab-full/cluster-setup.md rename to cluster-setup.md index b9d43dc..5eb5047 100644 --- a/k3s-homelab-full/cluster-setup.md +++ b/cluster-setup.md @@ -1,25 +1,25 @@ # Ced's K3s Cluster Setup – End-to-End -This document describes how your current K3s cluster is built so you can re‑create it later or explain it in GitHub/OneNote. +Note: All IP addresses and subnet ranges in this document have been replaced with placeholders for security. Substitute your own values where you see before running any commands. --- ## 1. Base Networking -**HomeLab VLAN:** `10.10.30.0/24` -**Gateway:** UniFi Dream Router -**DHCP:** Configured to *exclude* `.251–.254` so MetalLB can safely use that range. +**HomeLab VLAN:** `` +**Gateway:** UniFi Dream Router +**DHCP:** Configured to exclude the upper range so MetalLB can safely use that range. -- Proxmox VE: `10.10.30.250` -- MetalLB pool: `10.10.30.251–10.10.30.254` +- Proxmox VE: `` +- MetalLB pool: `` Subnets you have overall (for reference): -- Default: `10.10.1.0/24` (not used) -- Main: `10.10.10.0/24` -- IoT: `10.10.20.0/24` -- HomeLab: `10.10.30.0/24` -- Guest: `10.10.99.0/24` +- Default: `` (not used) +- Main: `` +- IoT: `` +- HomeLab: `` +- Guest: `` --- @@ -27,9 +27,9 @@ Subnets you have overall (for reference): ### Nodes -- `k3s-django-1` – `10.10.30.72` (control-plane, etcd, master) -- `k3s-django-2` – `10.10.30.245` (control-plane, etcd, master) -- `k3s-django-3` – `10.10.30.128` (control-plane, etcd, master) +- `k3s-django-1` – `` (control-plane, etcd, master) +- `k3s-django-2` – `` (control-plane, etcd, master) +- `k3s-django-3` – `` (control-plane, etcd, master) All three are Debian 12 (Bookworm, ARM64 on Raspberry Pi). @@ -56,7 +56,7 @@ sudo chown $(id -u):$(id -g) ~/.kube/config Update the kubeconfig to point to the node's real IP instead of `127.0.0.1`: ```bash -sed -i 's/https:\/\/127.0.0.1:6443/https:\/\/10.10.30.72:6443/' ~/.kube/config +sed -i 's/https:\/\/127.0.0.1:6443/https:\/\/:6443/' ~/.kube/config export KUBECONFIG=$HOME/.kube/config ``` @@ -80,10 +80,13 @@ echo "$TOKEN" On `k3s-django-2` and `k3s-django-3`: ```bash -export K3S_URL="https://10.10.30.72:6443" +export K3S_URL="https://:6443" export K3S_TOKEN="" -curl -sfL https://get.k3s.io | K3S_URL=$K3S_URL K3S_TOKEN=$K3S_TOKEN sh -s - server +curl -sfL https://get.k3s.io | \ + K3S_URL=$K3S_URL \ + K3S_TOKEN=$K3S_TOKEN \ + sh -s - server ``` Verify from `k3s-django-1`: @@ -101,7 +104,7 @@ You should now see all three `k3s-django-*` nodes as control-plane,etcd,master. You have 9 worker nodes grouped as: - Ingress: `k3s-node-1`, `k3s-node-2`, `k3s-node-3` -- Data: `k3s-node-4`, `k3s-node-5`, `k3s-node-6` +- Data: `k3s-node-4`, `k3s-node-5`, `k3s-node-6` - Monitoring: `k3s-node-7`, `k3s-node-8`, `k3s-node-9` ### 3.1 Join workers as agents @@ -109,10 +112,13 @@ You have 9 worker nodes grouped as: On each worker node (`k3s-node-N`), use: ```bash -export K3S_URL="https://10.10.30.72:6443" +export K3S_URL="https://:6443" export K3S_TOKEN="" -curl -sfL https://get.k3s.io | K3S_URL=$K3S_URL K3S_TOKEN=$K3S_TOKEN sh -s - agent +curl -sfL https://get.k3s.io | \ + K3S_URL=$K3S_URL \ + K3S_TOKEN=$K3S_TOKEN \ + sh -s - agent ``` Confirm from `k3s-django-1`: @@ -176,7 +182,7 @@ metadata: namespace: metallb-system spec: addresses: - - 10.10.30.251-10.10.30.254 + - ``` and `manifests/metallb/l2advertisement.yaml`: @@ -224,7 +230,11 @@ helm repo update Install ingress-nginx targeting the ingress node group: ```bash -helm install ingress-nginx ingress-nginx/ingress-nginx --namespace ingress-nginx --create-namespace --set controller.service.type=LoadBalancer --set controller.nodeSelector.ingress-node="true" +helm install ingress-nginx ingress-nginx/ingress-nginx \ + --namespace ingress-nginx \ + --create-namespace \ + --set controller.service.type=LoadBalancer \ + --set controller.nodeSelector.ingress-node="true" ``` Check: @@ -234,7 +244,7 @@ kubectl get pods -n ingress-nginx kubectl get svc -n ingress-nginx ingress-nginx-controller ``` -You should see `EXTERNAL-IP` assigned from MetalLB, e.g. `10.10.30.251`. +You should see `EXTERNAL-IP` assigned from MetalLB, e.g. ``. --- @@ -255,12 +265,12 @@ kubectl apply -f manifests/demo-app/demo-nginx.yaml Update your desktop hosts file: ```text -10.10.30.251 demo.local + demo.local ``` Open `http://demo.local` in a browser and you should see the nginx welcome page, served via: -Desktop → MetalLB VIP (10.10.30.251) → ingress-nginx → demo-nginx Service → Pods. +Desktop → MetalLB VIP (``) → ingress-nginx → demo-nginx Service → Pods. --- @@ -282,7 +292,9 @@ helm repo update Install with your custom values file: ```bash -helm install ceds-noc prometheus-community/kube-prometheus-stack --namespace monitoring -f kube-prom-values.yaml +helm install ceds-noc prometheus-community/kube-prometheus-stack \ + --namespace monitoring \ + -f kube-prom-values.yaml ``` `kube-prom-values.yaml` (included in this repo) pins Prometheus, Alertmanager, and Grafana to the `monitoring-node=true` nodes, configures PVCs for metrics and Grafana data, and exposes Grafana via a LoadBalancer (MetalLB). @@ -296,16 +308,16 @@ kubectl get svc -n monitoring You should see: -- `ceds-noc-grafana` as a `LoadBalancer` with an `EXTERNAL-IP` like `10.10.30.252` -- Prometheus, Alertmanager, kube-state-metrics, node exporters, etc. +- `ceds-noc-grafana` as a `LoadBalancer` with an `EXTERNAL-IP` like `` +- Prometheus, Alertmanager, kube state metrics, node exporters, etc. Open Grafana at: ```text -http://10.10.30.252 +http:// ``` -Username: `admin` +Username: `admin` Password: either the one in `kube-prom-values.yaml` (if set) or via: ```bash @@ -327,7 +339,7 @@ Choose the kube-prometheus-stack Prometheus datasource. You now have a live NOC for: - Cluster health (nodes, pods, API server) -- Per‑node CPU, RAM, disk, pod counts +- Per-node CPU, RAM, disk, pod counts - Ingress and MetalLB metrics --- @@ -337,4 +349,4 @@ You now have a live NOC for: - Add Loki + Promtail for logs - Add Prometheus alerting rules (node down, high CPU, low disk, etc) - Add Alertmanager integrations (Discord/Slack/email) -- Use GitOps (FluxCD or ArgoCD) to manage this repo as the source of truth. +- Use GitOps (FluxCD or ArgoCD) to manage this repo as the source of truth \ No newline at end of file diff --git a/k3s-homelab-full/dashboards/ced-noc/ced-noc-cluster-overview.json b/dashboards/ced-noc/ced-noc-cluster-overview.json similarity index 100% rename from k3s-homelab-full/dashboards/ced-noc/ced-noc-cluster-overview.json rename to dashboards/ced-noc/ced-noc-cluster-overview.json diff --git a/k3s-homelab-full/dashboards/ced-noc/ceds-noc-theme.json b/dashboards/ced-noc/ceds-noc-theme.json similarity index 100% rename from k3s-homelab-full/dashboards/ced-noc/ceds-noc-theme.json rename to dashboards/ced-noc/ceds-noc-theme.json diff --git a/k3s-homelab-full/dashboards/ced-noc/cluster-overview.json b/dashboards/ced-noc/cluster-overview.json similarity index 100% rename from k3s-homelab-full/dashboards/ced-noc/cluster-overview.json rename to dashboards/ced-noc/cluster-overview.json diff --git a/k3s-homelab-full/dashboards/ced_cluster_overview.json b/dashboards/ced_cluster_overview.json similarity index 100% rename from k3s-homelab-full/dashboards/ced_cluster_overview.json rename to dashboards/ced_cluster_overview.json diff --git a/k3s-homelab-full/dashboards/ced_ingress_metallb.json b/dashboards/ced_ingress_metallb.json similarity index 100% rename from k3s-homelab-full/dashboards/ced_ingress_metallb.json rename to dashboards/ced_ingress_metallb.json diff --git a/k3s-homelab-full/dashboards/ced_nodes_detail.json b/dashboards/ced_nodes_detail.json similarity index 100% rename from k3s-homelab-full/dashboards/ced_nodes_detail.json rename to dashboards/ced_nodes_detail.json diff --git a/k3s-homelab-full/diagrams/ced-k3s-from-text.txt b/diagrams/ced-k3s-from-text.txt similarity index 93% rename from k3s-homelab-full/diagrams/ced-k3s-from-text.txt rename to diagrams/ced-k3s-from-text.txt index e6e9300..1723323 100644 --- a/k3s-homelab-full/diagrams/ced-k3s-from-text.txt +++ b/diagrams/ced-k3s-from-text.txt @@ -1,6 +1,6 @@ # Ced's K3s HomeLab (for draw.io text import) -# Paste this into draw.io via: Arrange → Insert → Advanced → From text + Ced HomeLab VLAN 10.10.30.0/24 diff --git a/k3s-homelab-full/docs/per-node-notes.md b/docs/per-node-notes.md similarity index 100% rename from k3s-homelab-full/docs/per-node-notes.md rename to docs/per-node-notes.md diff --git a/k3s-homelab-full/README.md b/k3s-homelab-full/README.md deleted file mode 100644 index b443453..0000000 --- a/k3s-homelab-full/README.md +++ /dev/null @@ -1,57 +0,0 @@ -# Ced's K3s HomeLab (Raspberry Pi Cluster) - -This repo captures the working configuration of your HA K3s cluster: - -- 3× control-plane nodes: `k3s-django-1/2/3` -- 9× worker nodes split into: - - Ingress: `k3s-node-1..3` - - Data: `k3s-node-4..6` - - Monitoring: `k3s-node-7..9` -- MetalLB for LoadBalancer IPs on your HomeLab VLAN -- ingress-nginx as the main ingress controller -- kube-prometheus-stack (Prometheus + Grafana + Alertmanager + exporters) -- Ced's NOC dashboards for Grafana - -You can use this as a GitHub repo, import the dashboards into Grafana, and keep long‑term documentation of Ced's HomeLab. - -## Quick Start (once K3s cluster is up) - -On `k3s-django-1` with `KUBECONFIG` pointing at the cluster: - -```bash -git clone -cd k3s-homelab-full - -# 1) Label nodes into groups -./scripts/03_label_nodes.sh - -# 2) Install MetalLB -./scripts/10_install_metallb.sh - -# 3) Install ingress-nginx -./scripts/20_install_ingress_nginx.sh - -# 4) Install Ced's NOC (kube-prometheus-stack) -./scripts/30_install_ceds_noc.sh - -# 5) Deploy demo nginx ingress + Grafana/Prometheus ingress rules -kubectl apply -f manifests/demo-app/demo-nginx.yaml -kubectl apply -f manifests/ingress/grafana-ingress.yaml -kubectl apply -f manifests/ingress/prometheus-ingress.yaml -``` - -Then update your desktop `hosts` file to point: - -```text -10.10.30.251 demo.local grafana.local prometheus.local -``` - -## Structure - -- `cluster-setup.md` – step-by-step narrative of the full setup. -- `kube-prom-values.yaml` – values file for `kube-prometheus-stack` (Ced's NOC). -- `dashboards/` – starter Grafana dashboards in JSON. -- `scripts/` – helper scripts to label nodes and install MetalLB, ingress, and NOC. -- `manifests/` – YAML manifests for MetalLB, demo app, and ingresses. -- `docs/per-node-notes.md` – inventory of each node (IP, role, hardware). -- `diagrams/ced-k3s-from-text.txt` – text that can be imported into draw.io ("Arrange → Insert → Advanced → From text"). diff --git a/k3s-homelab-full/kube-prom-values.yaml b/kube-prom-values.yaml similarity index 100% rename from k3s-homelab-full/kube-prom-values.yaml rename to kube-prom-values.yaml diff --git a/k3s-homelab-full/manifests/demo-app/demo-nginx.yaml b/manifests/demo-app/demo-nginx.yaml similarity index 100% rename from k3s-homelab-full/manifests/demo-app/demo-nginx.yaml rename to manifests/demo-app/demo-nginx.yaml diff --git a/k3s-homelab-full/manifests/ingress/grafana-ingress.yaml b/manifests/ingress/grafana-ingress.yaml similarity index 100% rename from k3s-homelab-full/manifests/ingress/grafana-ingress.yaml rename to manifests/ingress/grafana-ingress.yaml diff --git a/k3s-homelab-full/manifests/ingress/prometheus-ingress.yaml b/manifests/ingress/prometheus-ingress.yaml similarity index 100% rename from k3s-homelab-full/manifests/ingress/prometheus-ingress.yaml rename to manifests/ingress/prometheus-ingress.yaml diff --git a/k3s-homelab-full/manifests/metallb/ipaddresspool.yaml b/manifests/metallb/ipaddresspool.yaml similarity index 100% rename from k3s-homelab-full/manifests/metallb/ipaddresspool.yaml rename to manifests/metallb/ipaddresspool.yaml diff --git a/k3s-homelab-full/manifests/metallb/l2advertisement.yaml b/manifests/metallb/l2advertisement.yaml similarity index 100% rename from k3s-homelab-full/manifests/metallb/l2advertisement.yaml rename to manifests/metallb/l2advertisement.yaml diff --git a/k3s-homelab-full/scripts/03_label_nodes.sh b/scripts/03_label_nodes.sh similarity index 100% rename from k3s-homelab-full/scripts/03_label_nodes.sh rename to scripts/03_label_nodes.sh diff --git a/k3s-homelab-full/scripts/10_install_metallb.sh b/scripts/10_install_metallb.sh similarity index 100% rename from k3s-homelab-full/scripts/10_install_metallb.sh rename to scripts/10_install_metallb.sh diff --git a/k3s-homelab-full/scripts/20_install_ingress_nginx.sh b/scripts/20_install_ingress_nginx.sh similarity index 100% rename from k3s-homelab-full/scripts/20_install_ingress_nginx.sh rename to scripts/20_install_ingress_nginx.sh diff --git a/k3s-homelab-full/scripts/30_install_ceds_noc.sh b/scripts/30_install_ceds_noc.sh similarity index 100% rename from k3s-homelab-full/scripts/30_install_ceds_noc.sh rename to scripts/30_install_ceds_noc.sh