Files
manoon-headless/k8s/service.yaml
Unchained 1ed6cac647
Some checks failed
Build and Deploy / build (push) Has been cancelled
fix(k8s): use NodePort with externalTrafficPolicy Local to preserve client IP
Change storefront service from ClusterIP to NodePort with externalTrafficPolicy: Local.
This preserves the real client source IP instead of NATing to the node IP.

Fixes analytics tracking showing Hetzner IP (138.201.11.251) instead of real visitor IPs.
Same fix previously applied to Rybbit backend service.

Note: On single-node clusters, this works seamlessly. Traefik routes directly
to the node where the pod is running, preserving the original source IP.
2026-04-03 06:55:42 +02:00

17 lines
426 B
YAML

apiVersion: v1
kind: Service
metadata:
name: storefront
namespace: manoonoils
spec:
# Use NodePort with externalTrafficPolicy: Local to preserve client source IP
# This is required for proper client IP detection in analytics (Rybbit, etc.)
type: NodePort
externalTrafficPolicy: Local
selector:
app: storefront
ports:
- port: 3000
targetPort: 3000
# Let Kubernetes assign a NodePort automatically