feat(ingress): route public domains to Swarm backends (#14)

## Summary

Make Kubernetes Traefik the common HTTP entrypoint while preserving the existing Swarm-hosted public domains.

## Routing

- `hermes.rudolf.keenetic.link` -> Kubernetes Service `hermes:9119`
- `brencher.rudolf.keenetic.link` -> `192.168.1.96:5001`
- `immich.rudolf.keenetic.link` -> `192.168.1.96:2283`
- `gitea.rudolf.keenetic.link` -> `192.168.1.96:3002`

The Swarm targets are represented by selectorless Services with static Endpoints. The router can use ordinary TCP forwarding to `192.168.1.114:80`, preserving the HTTP `Host` header for Traefik routing instead of using the Keenetic HTTP reverse-proxy feature.

## Validation

- `git diff --cached --check` passed
- Changed files are limited to the Hermes ingress, backend Services/Endpoints, Kustomization, and README
- `kubectl kustomize` was unavailable in the execution environment

Reviewed-on: org1/infra#14
Reviewed-by: admin <rudolfss13@gmail.com>
Co-authored-by: hermes <rudolfss13+hermes@gmail.com>
This commit is contained in:
2026-11-21 20:36:59 +01:00
committed by admin
parent 696aacfabe
commit e084ce4ecf
5 changed files with 141 additions and 0 deletions
@@ -0,0 +1,15 @@
# Shared public ingress
The common Traefik entrypoint routes public domains to Kubernetes and Swarm
backends. The router forwards TCP port `80` to `xu4_lan` (`192.168.1.114`).
| Domain | Backend |
| --- | --- |
| `hermes.rudolf.keenetic.link` | Kubernetes Service `hermes:9119` |
| `brencher.rudolf.keenetic.link` | Swarm `192.168.1.96:5001` |
| `immich.rudolf.keenetic.link` | Swarm `192.168.1.96:2283` |
| `gitea.rudolf.keenetic.link` | Swarm `192.168.1.96:3002` |
The Swarm backends are represented by selectorless Kubernetes Services and
static Endpoints. The Swarm ports must remain reachable from the Traefik node
at `192.168.1.96`.
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- swarm-backends.yaml
- public-ingress.yaml
@@ -0,0 +1,40 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: public-ingress
namespace: hermes
labels:
app.kubernetes.io/name: public-ingress
spec:
ingressClassName: traefik
rules:
- host: brencher.rudolf.keenetic.link
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: brencher-swarm
port:
name: http
- host: immich.rudolf.keenetic.link
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: immich-swarm
port:
name: http
- host: gitea.rudolf.keenetic.link
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: gitea-swarm
port:
name: http
@@ -0,0 +1,80 @@
apiVersion: v1
kind: Service
metadata:
namespace: hermes
name: brencher-swarm
labels:
app.kubernetes.io/name: brencher-swarm
spec:
ports:
- name: http
port: 5001
targetPort: 5001
protocol: TCP
---
apiVersion: v1
kind: Endpoints
metadata:
namespace: hermes
name: brencher-swarm
subsets:
- addresses:
- ip: 192.168.1.96
ports:
- name: http
port: 5001
protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
namespace: hermes
name: immich-swarm
labels:
app.kubernetes.io/name: immich-swarm
spec:
ports:
- name: http
port: 2283
targetPort: 2283
protocol: TCP
---
apiVersion: v1
kind: Endpoints
metadata:
namespace: hermes
name: immich-swarm
subsets:
- addresses:
- ip: 192.168.1.96
ports:
- name: http
port: 2283
protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
namespace: hermes
name: gitea-swarm
labels:
app.kubernetes.io/name: gitea-swarm
spec:
ports:
- name: http
port: 3002
targetPort: 3002
protocol: TCP
---
apiVersion: v1
kind: Endpoints
metadata:
namespace: hermes
name: gitea-swarm
subsets:
- addresses:
- ip: 192.168.1.96
ports:
- name: http
port: 3002
protocol: TCP
+1
View File
@@ -4,6 +4,7 @@ resources:
- k3s_rencher/flux-system
- k3s_rencher/infrastructure/dns
- k3s_rencher/infrastructure/agent-gateway
- k3s_rencher/infrastructure/ingress
- k3s_rencher/apps/hermes
- k3s_rencher/apps/hermes/generic1
- k3s_rencher/apps/hermes/generic2