Files
Kubernetes/README.md
T
gitea_admin 36fbaf171a Add firewall and home LAN access docs, ComfyUI image generation, and backup plan
Document the Hetzner Cloud Firewall posture (inbound from private/home only, outbound allow-all, egress-only IPv6, public IPs on workers) in a new `Cluster_admin/firewall.md` and reference it from `AGENTS.md`, `Environment.md`, and `README.md`. Update the Mailu README to note that SMTP/IMAP ports are not currently exposed.

Add `HomeAccess/` with a privileged DaemonSet and README that give cluster nodes a route to `192.168.8.0/24` via point-to-point GRE tunnels to the master and its WireGuard tunnel.

Wire Open WebUI to ComfyUI on pop-os through a new `openwebui-imagegen` ConfigMap consumed via `envFrom`, with migration notes covering the PersistentConfig DB override.

Bump kube-prometheus-stack to 88.6.1 with an 8GB `retentionSize` cap, grow the postgres PVC to 50Gi, and add a PostgreSQL backup plan for pg_dumpall/rclone streaming to a Hetzner Storage Box.
2026-12-01 12:36:14 +02:00

108 lines
4.0 KiB
Markdown

# Kubernetes Manifests
Collection of Kubernetes manifests for self-hosted services running on a
homelab cluster.
## Layout
| Directory | Description |
|------------------|---------------------------------------------------------------|
| `Cilium/` | Cilium networking: `LoadBalancerIPPool`, `L2AnnouncementPolicy`, Ingress examples |
| `Cluster_admin/` | Admin notes: node restart commands, firewall/egress, data migration examples |
| `DockerRegistry/`| Private Docker registry deployment, service, PVC and UI |
| `Gitea/` | Gitea deployment, service, ingress, namespace, PVC, DB secret |
| `Immich/` | Immich server, machine-learning, redis, config, secret |
| `Monitoring/` | Prometheus Operator (kube-prometheus-stack Helm release) + hand-managed Grafana |
| `PostgreSQL/` | PostgreSQL deployment, service, PVC, static endpoint, Hetzner volume variant |
| `Secrets/` | Docker registry login credentials (gitignored) |
| `volume/` | Persistent volume claim and SMB volume examples |
## Usage
Apply a manifest with:
```bash
kubectl apply -f <path/to/manifest.yaml>
```
## Monitoring stack
The `Monitoring/` directory runs the **kube-prometheus-stack** Helm chart
(prometheus-operator + CRDs + node-exporter + kube-state-metrics) plus a
hand-managed Grafana.
Install the chart once:
```bash
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
helm install kube-prometheus-stack prometheus-community/kube-prometheus-stack \
--namespace monitoring --create-namespace \
--version 87.3.0 \
-f Monitoring/kube-prometheus-stack.values.yaml
```
Upgrade after editing `Monitoring/kube-prometheus-stack.values.yaml`:
```bash
helm upgrade kube-prometheus-stack prometheus-community/kube-prometheus-stack \
--namespace monitoring --version 87.3.0 \
-f Monitoring/kube-prometheus-stack.values.yaml
```
Add scrape targets by creating `ServiceMonitor` / `PodMonitor` CRs in any
namespace; the Prometheus CR selects all of them (`serviceMonitorSelector: {}`).
Apply the Grafana manifests in `Monitoring/Grafana/` separately (its datasource
points at `prometheus-operated.monitoring.svc.cluster.local:9090`).
## Notes
- Kubernetes `Secret` resources and the `Secrets/` directory are gitignored to
avoid leaking credentials. Create secrets out-of-band, e.g.:
```bash
kubectl create secret docker-registry dockerhub-creds \
--namespace=<ns> \
--docker-server=<server> \
--docker-username=<user> \
--docker-password=<password> \
--docker-email=<email>
```
- Review every manifest before applying it to a production cluster.
## Private registry authentication
`rg.mariushome.lt` requires htpasswd auth. Two out-of-band secrets must be
created before applying `DockerRegistry/docker_registry_deploy.yaml` and any
workload pulling from the registry (e.g. `postgres-hetzner`).
1. **Registry htpasswd file** (consumed by the registry pod). Generate the
htpasswd entry, then create the Secret in the `registry` namespace:
```bash
htpasswd -Bbn <user> <password> > htpasswd
kubectl create secret generic registry-htpasswd \
--namespace=registry \
--from-file=htpasswd=htpasswd
rm htpasswd
```
The deployment mounts this Secret at `/etc/docker/registry/htpasswd` and
configures the registry with `REGISTRY_AUTH=htpasswd`.
2. **`registry-creds` imagePullSecret** — one per namespace that pulls from
`rg.mariushome.lt`. Create it in every namespace that runs workloads
referencing the registry (e.g. `database`):
```bash
kubectl create secret docker-registry registry-creds \
--namespace=<ns> \
--docker-server=rg.mariushome.lt \
--docker-username=<user> \
--docker-password=<password> \
--docker-email=<email>
```
Manifests reference it as `imagePullSecrets: [{ name: registry-creds }]`.
Rebuild/repush the image per `Docker/PostgreSQL/PostgreSQL_Build.sh` after
rotating credentials.