feat: platform backbone and field capture, first part (checkpoint)
Platform backbone (plan 2026-10-13-plattform-rueckgrat), reviewed tasks: - run roles api/worker/job/all with shared startup checks (Task 1) - schema and migration for DomainEvent, deliveries, JobRun, ThrottlerHit (Task 2) - audit, notifications and domain events written in the same transaction (Task 3) - dispatcher with SKIP LOCKED claims, retries and stale release (Task 4) - worker building blocks: tick, LISTEN/NOTIFY wake-up, health (Task 5) - worker process and entry points (Task 6) - throttler counters in Postgres (Task 19) - separate keys per purpose with key ring (Task 20) - public origin page without exact location (Task 22) - shop keys split into read and write (Task 23) - Kustomize base, components, overlay encry, CI validation (Task 26) Field capture T3 (plan 2026-10-13-t3-erfassung-am-stand), reviewed tasks: - brood frames, read endpoints, apiary overview and offline pack - network basics, offline queue v3, navigation sheets, form building blocks - new inspection with last-time hints and weather, varroa per day, treatment prefill, apiary page with round - inspection photo (Task 10) is implemented, review pending Not rolled out. Remaining tasks follow in later commits. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
10cbe9bf2d
commit
c01a38835a
340 files changed
+25695
-1808
No files matched your search
@@ -0,0 +1,22 @@
|
||||
# cert-manager loest HTTP-01 (ClusterIssuer letsencrypt-prod, Klasse traefik)
|
||||
# mit kurzlebigen Solver-Pods in diesem Namespace. Traefik muss sie auf 8089
|
||||
# erreichen, sonst scheitert jede Zertifikatserneuerung. Sonst niemand.
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: acme-http01-solver
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
acme.cert-manager.io/http01-solver: "true"
|
||||
policyTypes: [Ingress, Egress]
|
||||
ingress:
|
||||
- from:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: kube-system
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: rke2-traefik
|
||||
ports:
|
||||
- {protocol: TCP, port: 8089}
|
||||
@@ -0,0 +1,19 @@
|
||||
# Jeder Pod darf Namen aufloesen, aber nur bei CoreDNS in kube-system.
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: allow-dns
|
||||
spec:
|
||||
podSelector: {}
|
||||
policyTypes: [Egress]
|
||||
egress:
|
||||
- to:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: kube-system
|
||||
podSelector:
|
||||
matchLabels:
|
||||
k8s-app: kube-dns
|
||||
ports:
|
||||
- {protocol: UDP, port: 53}
|
||||
- {protocol: TCP, port: 53}
|
||||
@@ -0,0 +1,42 @@
|
||||
# API: Anfragen von Traefik und vom Frontend. Raus nur zu Postgres und per
|
||||
# 443 zu oeffentlichen Adressen (Have I Been Pwned, Open-Meteo, Entra-Login).
|
||||
# Canal kennt keine FQDN-Regeln, darum "443 ohne private Bereiche"; den
|
||||
# SSRF-Schutz fuer Webhook-Ziele behaelt die App (webhook-url-guard.ts).
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: apicore-api
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: apicore-backend
|
||||
policyTypes: [Ingress, Egress]
|
||||
ingress:
|
||||
- from:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: kube-system
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: rke2-traefik
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
app: apicore-frontend
|
||||
ports:
|
||||
- {protocol: TCP, port: 3001}
|
||||
egress:
|
||||
- to:
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: apicore-postgres
|
||||
ports:
|
||||
- {protocol: TCP, port: 5432}
|
||||
- to:
|
||||
- ipBlock:
|
||||
cidr: "0.0.0.0/0"
|
||||
except: ["10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "100.64.0.0/10", "169.254.0.0/16", "127.0.0.0/8"]
|
||||
- ipBlock:
|
||||
cidr: "::/0"
|
||||
except: ["fc00::/7", "fe80::/10", "::1/128"]
|
||||
ports:
|
||||
- {protocol: TCP, port: 443}
|
||||
@@ -0,0 +1,8 @@
|
||||
# Alles zu, was keine andere Policy ausdruecklich erlaubt (beide Richtungen).
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: default-deny
|
||||
spec:
|
||||
podSelector: {}
|
||||
policyTypes: [Ingress, Egress]
|
||||
@@ -0,0 +1,28 @@
|
||||
# Frontend: Anfragen nur von Traefik. Raus nur zum Backend auf 3001, kein
|
||||
# Weg zu Postgres und keiner ins Internet.
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: apicore-frontend
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: apicore-frontend
|
||||
policyTypes: [Ingress, Egress]
|
||||
ingress:
|
||||
- from:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: kube-system
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: rke2-traefik
|
||||
ports:
|
||||
- {protocol: TCP, port: 3000}
|
||||
egress:
|
||||
- to:
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
app: apicore-backend
|
||||
ports:
|
||||
- {protocol: TCP, port: 3001}
|
||||
@@ -0,0 +1,18 @@
|
||||
# CronJob-Pods (App-Jobs und pg_dump): nehmen nichts an, reden nur mit
|
||||
# Postgres. Das Backup-Ziel ist ein Volume, kein Netzweg aus dem Pod.
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: apicore-jobs
|
||||
spec:
|
||||
podSelector:
|
||||
matchExpressions:
|
||||
- {key: app, operator: In, values: [apicore-job, apicore-db-backup]}
|
||||
policyTypes: [Ingress, Egress]
|
||||
egress:
|
||||
- to:
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: apicore-postgres
|
||||
ports:
|
||||
- {protocol: TCP, port: 5432}
|
||||
@@ -0,0 +1,19 @@
|
||||
# NetworkPolicies nach Spec 2026-10-12 Abschnitt 5.2: Default-Deny fuer
|
||||
# Ingress und Egress, danach nur die Wege, die jede Rolle braucht.
|
||||
# Kubelet-Probes erlaubt Kubernetes immer, sie brauchen keine Regel.
|
||||
# Rollout: Runbook Schritt 2 (vorher Selektoren gegen den Live-Stand pruefen).
|
||||
# Das Label db-client an der api (patch-api-db-client.yaml) aendert das
|
||||
# Pod-Template: die api startet dabei einmal neu.
|
||||
apiVersion: kustomize.config.k8s.io/v1alpha1
|
||||
kind: Component
|
||||
resources:
|
||||
- default-deny.yaml
|
||||
- allow-dns.yaml
|
||||
- frontend.yaml
|
||||
- api.yaml
|
||||
- worker.yaml
|
||||
- jobs.yaml
|
||||
- postgres.yaml
|
||||
- acme-http01-solver.yaml
|
||||
patches:
|
||||
- path: patch-api-db-client.yaml
|
||||
@@ -0,0 +1,14 @@
|
||||
# Die api darf zu Postgres. apicore-postgres laesst nur Pods mit
|
||||
# db-client: "true" herein, darum setzt diese Komponente das Label selbst:
|
||||
# schon Runbook Schritt 2 (nur NetworkPolicies) braucht es, sonst ist die
|
||||
# api von der DB abgeschnitten. Worker, Jobs und pg_dump tragen das Label in
|
||||
# ihren eigenen Manifesten.
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: apicore-backend
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
db-client: "true"
|
||||
@@ -0,0 +1,20 @@
|
||||
# Postgres: 5432 nur fuer Pods mit db-client: "true" (api, worker, Jobs,
|
||||
# pg_dump) im selben Namespace. Raus nichts ausser DNS (allow-dns).
|
||||
# Der Selektor muss zu den Pod-Labels in base/postgres/statefulset.yaml
|
||||
# passen; der Test manifest-policy.test.mjs prueft das.
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: apicore-postgres
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: apicore-postgres
|
||||
policyTypes: [Ingress, Egress]
|
||||
ingress:
|
||||
- from:
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
db-client: "true"
|
||||
ports:
|
||||
- {protocol: TCP, port: 5432}
|
||||
@@ -0,0 +1,27 @@
|
||||
# Worker: nimmt nichts an (die Probes kommen vom Kubelet). Raus zu Postgres
|
||||
# und per 443 zu oeffentlichen Adressen (Graph, Webhook-Ziele), wie die API.
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: apicore-worker
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: apicore-worker
|
||||
policyTypes: [Ingress, Egress]
|
||||
egress:
|
||||
- to:
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: apicore-postgres
|
||||
ports:
|
||||
- {protocol: TCP, port: 5432}
|
||||
- to:
|
||||
- ipBlock:
|
||||
cidr: "0.0.0.0/0"
|
||||
except: ["10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "100.64.0.0/10", "169.254.0.0/16", "127.0.0.0/8"]
|
||||
- ipBlock:
|
||||
cidr: "::/0"
|
||||
except: ["fc00::/7", "fe80::/10", "::1/128"]
|
||||
ports:
|
||||
- {protocol: TCP, port: 443}
|
||||
Reference in new issue
Block a user