|
1 | 1 | # k3s-lab |
2 | 2 |
|
| 3 | +[](https://github.com/KevinDeBenedetti/k3s-lab/actions/workflows/ci-cd.yml) |
| 4 | + |
3 | 5 | > Production-ready k3s cluster on VPS — automated setup with Traefik, cert-manager, Prometheus, Grafana, Loki, and Promtail. |
4 | 6 |
|
5 | | -[](https://github.com/KevinDeBenedetti/k3s-lab/actions/workflows/ci-cd.yml) |
| 7 | +## Features |
| 8 | + |
| 9 | +- Lightweight Kubernetes via [k3s](https://k3s.io) with automated control-plane and worker bootstrap |
| 10 | +- Ingress + automatic HTTPS via [Traefik](https://traefik.io) and [cert-manager](https://cert-manager.io) (Let's Encrypt HTTP-01) |
| 11 | +- Full observability stack: Prometheus, Grafana, Alertmanager, Loki, and Promtail |
| 12 | +- Makefile-driven workflow — one target per lifecycle stage |
| 13 | +- Static CI: ShellCheck, actionlint, kubeconform, Bats, and secret scanning (no live cluster required) |
| 14 | +- Reusable as a git submodule with includeable Makefile fragments |
6 | 15 |
|
7 | | -## Stack |
| 16 | +## Prerequisites |
8 | 17 |
|
9 | | -| Tool | Role | |
10 | | -|---|---| |
11 | | -| [k3s](https://k3s.io) | Lightweight Kubernetes distribution | |
12 | | -| [Traefik](https://traefik.io) | Ingress controller + HTTPS | |
13 | | -| [cert-manager](https://cert-manager.io) | Automatic TLS via Let's Encrypt | |
14 | | -| [kube-prometheus-stack](https://github.com/prometheus-community/helm-charts) | Prometheus + Grafana + Alertmanager | |
15 | | -| [Loki](https://grafana.com/oss/loki/) | Centralized log storage | |
16 | | -| [Promtail](https://grafana.com/docs/loki/latest/send-data/promtail/) | Log collector | |
| 18 | +- A VPS with SSH access |
| 19 | +- `make`, `kubectl`, `helm` |
| 20 | +- Secrets configured in `.env` (copy from `.env.example`) |
17 | 21 |
|
18 | | -## Quick start |
| 22 | +## Usage |
19 | 23 |
|
20 | 24 | ```bash |
21 | | -cp .env.example .env # Fill in your values |
22 | | -make k3s-master # Bootstrap control plane (~5 min) |
23 | | -make k3s-worker # Join worker node (~3 min) |
24 | | -make kubeconfig # Fetch kubeconfig |
25 | | -make deploy-dashboard-secret |
26 | | -make deploy # Traefik + cert-manager (~3 min) |
27 | | -make deploy-grafana-secret |
28 | | -make deploy-monitoring # Prometheus + Grafana + Loki (~10 min) |
| 25 | +cp .env.example .env # fill in your values |
| 26 | +make k3s-master # bootstrap control plane |
| 27 | +make k3s-worker # join worker node |
| 28 | +make kubeconfig # fetch kubeconfig |
| 29 | +make deploy # deploy Traefik + cert-manager |
| 30 | +make deploy-monitoring # deploy Prometheus + Grafana + Loki |
29 | 31 | ``` |
30 | 32 |
|
31 | | -## Documentation |
32 | | - |
33 | | -📖 **[kevindebenedetti.github.io/k3s-lab](https://kevindebenedetti.github.io/k3s-lab)** |
34 | | - |
35 | | -| | | |
36 | | -|---|---| |
37 | | -| [Getting started](https://kevindebenedetti.github.io/k3s-lab/getting-started) | Prerequisites, step-by-step deploy | |
38 | | -| [Configuration](https://kevindebenedetti.github.io/k3s-lab/configuration) | All `.env` variables | |
39 | | -| [k3s](https://kevindebenedetti.github.io/k3s-lab/stack/k3s) | Install flags, sysctl, firewall | |
40 | | -| [Traefik](https://kevindebenedetti.github.io/k3s-lab/stack/traefik) | Ingress, TLS, dashboard | |
41 | | -| [cert-manager](https://kevindebenedetti.github.io/k3s-lab/stack/cert-manager) | Let's Encrypt, HTTP-01 | |
42 | | -| [Monitoring](https://kevindebenedetti.github.io/k3s-lab/stack/monitoring) | Prometheus, Grafana, Loki | |
43 | | -| [Make targets](https://kevindebenedetti.github.io/k3s-lab/operations/make-targets) | Full `make` reference | |
44 | | -| [Troubleshooting](https://kevindebenedetti.github.io/k3s-lab/operations/troubleshooting) | Common issues | |
| 33 | +→ Full guide: [docs](https://kevindebenedetti.github.io/k3s-lab/getting-started) |
45 | 34 |
|
46 | | -## Submodule usage |
47 | | - |
48 | | -```bash |
49 | | -git submodule add https://github.com/KevinDeBenedetti/k3s-lab.git k3s-lab |
50 | | -``` |
| 35 | +## Documentation |
51 | 36 |
|
52 | | -```makefile |
53 | | -K3S_LAB := $(ROOT_DIR)/k3s-lab |
54 | | -include $(K3S_LAB)/makefiles/30-k3s.mk |
55 | | -include $(K3S_LAB)/makefiles/40-kubeconfig.mk |
56 | | -include $(K3S_LAB)/makefiles/50-deploy.mk |
57 | | -include $(K3S_LAB)/makefiles/60-status.mk |
58 | | -include $(K3S_LAB)/makefiles/70-ssh.mk |
59 | | -``` |
| 37 | +Full documentation is available at **https://kevindebenedetti.github.io/k3s-lab/**. |
| 38 | +It is generated from the `docs/` directory and published automatically on push. |
0 commit comments