chore: k8s manifests and Gitea CI for ins-landing.containerverse.dev

Modelled on dynamic-qr: Traefik Gateway with Let's Encrypt, Longhorn PVC,
1 replica with Recreate, Calico network policies, and a rate limit on
POST /api/leads. CI runs the tests in a Dockerfile stage before pushing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfmHGGiYUjNcvJoyzdf
This commit is contained in:
ngqileandClaude Opus 5.5 committed 2026-12-01 11:24:33 +08:00
1 parent 0d50d3c09c
commit 91b6b31644
8 files changed
+590 -10

No files matched your search

+124
View File
@@ -0,0 +1,124 @@
# Served by Traefik through the Gateway API (GatewayClass `traefik`), the same way as dynamic-qr.
# Cloudflare connects to the origin over HTTPS: port 8443 is Traefik's `websecure` entry point
# (host port 443), 8000 its `web` entry point (host port 80), which only redirects to HTTPS.
#
# Let's Encrypt certificate via cert-manager (ClusterIssuer `lets-encrypt`, HTTP-01). The solver
# pod runs in this namespace and is allowed in by k8s/60-network-policy.yaml.
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: ins-landing-page-tls
namespace: ins-landing-page
spec:
secretName: ins-landing-page-tls
issuerRef:
group: cert-manager.io
kind: ClusterIssuer
name: lets-encrypt
dnsNames:
- ins-landing.containerverse.dev
usages:
- digital signature
- key encipherment
---
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: ins-landing-page
namespace: ins-landing-page
spec:
gatewayClassName: traefik
listeners:
- name: http
protocol: HTTP
port: 8000
allowedRoutes:
namespaces:
from: Same
- name: websecure
protocol: HTTPS
port: 8443
hostname: ins-landing.containerverse.dev
tls:
mode: Terminate
certificateRefs:
- kind: Secret
group: ""
name: ins-landing-page-tls
allowedRoutes:
namespaces:
from: Same
---
# Plain HTTP: permanent redirect to HTTPS.
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: https-redirect
namespace: ins-landing-page
spec:
parentRefs:
- name: ins-landing-page
sectionName: http
hostnames:
- ins-landing.containerverse.dev
rules:
- matches:
- path:
type: PathPrefix
value: /
filters:
- type: RequestRedirect
requestRedirect:
scheme: https
port: 443
statusCode: 301
---
# The lead form is public; the honeypot only stops naive bots. Limit form posts per visitor so a
# script cannot fill the volume. depth: 1 takes the right-most X-Forwarded-For entry, which
# Cloudflare sets to the visitor (Traefik keeps that header only from Cloudflare's ranges).
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: lead-rate-limit
namespace: ins-landing-page
spec:
rateLimit:
average: 5
period: 1m
burst: 5
sourceCriterion:
ipStrategy:
depth: 1
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: ins-landing-page
namespace: ins-landing-page
spec:
parentRefs:
- name: ins-landing-page
sectionName: websecure
hostnames:
- ins-landing.containerverse.dev
rules:
- matches:
- path:
type: Exact
value: /api/leads
filters:
- type: ExtensionRef
extensionRef:
group: traefik.io
kind: Middleware
name: lead-rate-limit
backendRefs:
- name: ins-landing-page
port: 3000
- matches:
- path:
type: PathPrefix
value: /
backendRefs:
- name: ins-landing-page
port: 3000