Files
vitfit-r2/V2/deploy/k8s/07-ingress.yaml
T
2026-06-13 08:03:45 -04:00

55 lines
2.0 KiB
YAML

# Nginx Ingress with TLS.
#
# ── Option A: Let's Encrypt (cert-manager) ────────────────────────────────────
# Requires cert-manager + ClusterIssuer from 06-cluster-issuer.yaml.
# Switch between staging and prod by changing the annotation value.
# cert-manager will auto-create the Secret named in tls.secretName.
#
# ── Option B: Custom / uploaded certificate ───────────────────────────────────
# 1. Remove (or comment out) the cert-manager annotation.
# 2. Pre-create the TLS Secret:
# kubectl create secret tls vitfit-tls \
# --namespace=vitfit \
# --cert=/path/to/your.crt \
# --key=/path/to/your.key
# 3. The tls.secretName below stays the same — no other changes needed.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: vitfit
namespace: vitfit
annotations:
# ── [LE] cert-manager — comment out for custom cert (Option B)
cert-manager.io/cluster-issuer: "letsencrypt-prod"
# WebSocket support (socket.io)
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-buffering: "off"
# Video upload size — match UPLOAD_MAX_BYTES
nginx.ingress.kubernetes.io/proxy-body-size: "2100m"
# Force HTTPS
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
ingressClassName: nginx
tls:
- hosts:
- your.domain.com # replace with your domain
secretName: vitfit-tls # cert-manager creates this (LE) or you create it (custom)
rules:
- host: your.domain.com # replace with your domain
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: vitfit
port:
name: http