feat: poblar scaffold inicial del shape rest-api/python
Reemplaza el placeholder mínimo previo por el scaffold canónico del golden path rest-api/python (entry point para tier free-trial): - code/app/main.py — FastAPI con /health (sin DB), /metrics, middleware correlation_id, settings Pydantic - code/tests/ — pytest + httpx TestClient (sin testcontainers, sin Docker) - helm/APP_NAME/ — chart minimal: Deployment, Service, IngressRoute, NetworkPolicy. SIN Job Alembic, SIN ServiceMonitor, SIN claim de BD - coralware-shape.yaml — shapeVersion 1.0.0, minTier free-trial, promotionPath -> web-backend-python cuando se requiera persistencia - .gitea/workflows/APP_NAME-build.yaml — invoca reusable workflow ADR-038 + job helm-deploy con KUBECONFIG_TENANT_B64 Diferencias con web-backend/python: sin alembic, sin BD, sin testcontainers, NetworkPolicy sin acceso a ns-addons. Placeholders __APP_NAME__, __TIER__, __TENANT_ID__, __TENANT_ID_NODASHES__ serán sustituidos server-side por repo-provisioner. El openspec/ del golden path NO se sincroniza al repo Gitea (gobernanza interna de Coralware). Refs: ADR-027 (Golden Paths), ADR-038 (CI), ADR-053 (referencia anatomía).
This commit is contained in:
57
helm/APP_NAME/templates/networkpolicy.yaml
Normal file
57
helm/APP_NAME/templates/networkpolicy.yaml
Normal file
@@ -0,0 +1,57 @@
|
||||
{{- if .Values.networkPolicy.enabled }}
|
||||
# NetworkPolicy mínima del shape rest-api: bajo deny-all-default del namespace, permite:
|
||||
# - Ingress: Traefik (público) + Prometheus (scrape de /metrics).
|
||||
# - Egress: DNS, Harbor pull HTTPS.
|
||||
# Sin acceso a ns-addons (rest-api no tiene BD por diseño).
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: {{ .Release.Name }}
|
||||
labels:
|
||||
{{- include "app.labels" . | nindent 4 }}
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
{{- include "app.selectorLabels" . | nindent 6 }}
|
||||
policyTypes: [Ingress, Egress]
|
||||
|
||||
ingress:
|
||||
# Tráfico HTTP desde Traefik (IngressRoute)
|
||||
- from:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: traefik-system
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 8000
|
||||
# Scrape de métricas Prometheus
|
||||
- from:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: cattle-monitoring-system
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: prometheus
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 8000
|
||||
|
||||
egress:
|
||||
# DNS
|
||||
- to:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: kube-system
|
||||
ports:
|
||||
- protocol: UDP
|
||||
port: 53
|
||||
- protocol: TCP
|
||||
port: 53
|
||||
# Harbor pull (registro de imágenes) — HTTPS abierto
|
||||
- to:
|
||||
- ipBlock:
|
||||
cidr: 0.0.0.0/0
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 443
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user