2026-10-09 12:57:31 +00:00
|
|
|
# argocd
|
|
|
|
|
|
2026-10-09 15:03:25 +02:00
|
|
|
GitOps for the homelab k3s cluster (`k3s-design.md`). Argo CD watches this repo
|
|
|
|
|
on Forgejo and deploys whatever is on `main`.
|
|
|
|
|
|
|
|
|
|
## Layout
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
bootstrap/root.yaml the only thing applied by hand: the "root" Application -> cluster/
|
|
|
|
|
cluster/ cluster-level Argo objects (app-of-apps)
|
2026-10-09 15:10:32 +02:00
|
|
|
argocd.yaml Argo CD manages its own install from argocd-install/
|
2026-10-09 15:03:25 +02:00
|
|
|
apps.yaml ApplicationSet: one Application per folder in apps/
|
2026-10-09 15:10:32 +02:00
|
|
|
argocd-install/ Argo CD install (upstream install.yaml pinned + small patches)
|
2026-10-09 15:03:25 +02:00
|
|
|
apps/<name>/ one app per folder, deployed to namespace <name>
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Argo reads the repo at `http://10.0.0.14:3000/un-oeil/argocd.git` (Forgejo's
|
|
|
|
|
internal address): pods can't reach `forgejo.un-oeil.fr` because the host has no
|
|
|
|
|
hairpin NAT. The repo is public, so no credentials are needed.
|
|
|
|
|
|
|
|
|
|
## Bootstrap (once)
|
|
|
|
|
|
|
|
|
|
Over WireGuard, with `KUBECONFIG=~/.kube/k3s-homelab.yaml`. Push this repo first:
|
|
|
|
|
Argo pulls from Forgejo, not from your laptop.
|
|
|
|
|
|
|
|
|
|
```bash
|
2026-10-09 15:10:32 +02:00
|
|
|
kubectl apply --server-side -k argocd-install/
|
2026-10-09 15:03:25 +02:00
|
|
|
kubectl -n argocd rollout status deploy/argocd-server
|
|
|
|
|
kubectl apply -f bootstrap/root.yaml
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Admin password (user `admin`), then change it in the UI and delete the secret:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' | base64 -d; echo
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
UI: either `kubectl -n argocd port-forward svc/argocd-server 8080:80` →
|
|
|
|
|
http://localhost:8080, or add `10.0.0.141 argocd.un-oeil.fr` to `/etc/hosts` →
|
|
|
|
|
http://argocd.un-oeil.fr. Argo CD is admin-only: **don't add it to Caddy**.
|
|
|
|
|
|
|
|
|
|
## Launching an app
|
|
|
|
|
|
|
|
|
|
1. Create `apps/<name>/` (copy `apps/whoami/`). Its contents can be:
|
|
|
|
|
- plain manifests, or
|
|
|
|
|
- a `kustomization.yaml` (Helm charts work too via `helmCharts:`), or
|
|
|
|
|
- a `Chart.yaml` (umbrella chart with the real chart as a dependency + `values.yaml`).
|
|
|
|
|
2. Commit and push. Argo picks it up within ~3 min (or hit *Refresh* in the UI)
|
|
|
|
|
and creates namespace `<name>`.
|
|
|
|
|
3. To make it public: add an Ingress with host `<name>.un-oeil.fr`, then a Caddy
|
|
|
|
|
vhost (LXC 100) pointing at Traefik on `10.0.0.141-143:80`.
|
|
|
|
|
|
|
|
|
|
Removing a folder deletes the app **and its resources, PVCs included**.
|
|
|
|
|
|
|
|
|
|
## Not there yet
|
|
|
|
|
|
|
|
|
|
- Storage: only k3s `local-path` (data stuck on one node). Longhorn is the next app.
|
|
|
|
|
- Secrets: nothing yet. Don't commit plain Secrets; add Sealed Secrets or SOPS first.
|
|
|
|
|
- Forgejo webhook → Argo for instant syncs instead of 3 min polling.
|