apiVersion: apps/v1 kind: Deployment metadata: name: app-deployment labels: app: app spec: replicas: 1 selector: matchLabels: app: app template: metadata: labels: app: app spec: imagePullSecrets: - name: gitea-registry-secret # Nivel Pod: nada corre como root a menos que el overlay lo # sobreescriba explícitamente (y debería justificarlo si lo hace). securityContext: runAsNonRoot: true seccompProfile: type: RuntimeDefault containers: - name: app # CAMBIAR: imagen real de tu app. El overlay la sobreescribe. image: gitea.cruzcloud.net/devops/CAMBIAR-imagen:v0.0.0 ports: - name: http containerPort: 8080 # Nivel contenedor: complementa el runAsNonRoot de arriba. # readOnlyRootFilesystem queda en false por default porque # muchos runtimes (Next.js standalone, cachés de npm/pip) # escriben en disco al arrancar -- si tu app NO escribe nada # en runtime, ponelo en true y listo (más seguro). securityContext: allowPrivilegeEscalation: false readOnlyRootFilesystem: false capabilities: drop: - ALL # CAMBIAR: casi seguro tu app expone un endpoint de salud # distinto a "/" (ver README de tu arquetipo de pipeline — # los 3 arquetipos ya documentan cuál usa cada stack). readinessProbe: httpGet: path: / port: http initialDelaySeconds: 5 periodSeconds: 10 timeoutSeconds: 5 failureThreshold: 6 livenessProbe: httpGet: path: / port: http initialDelaySeconds: 15 periodSeconds: 20 timeoutSeconds: 5 failureThreshold: 6 # Límites conservadores para una app chica/media. Subilos en # tu overlay si tu app realmente los necesita — pero no los # borres: sin esto, un solo pod con un bug de memoria puede # arrastrar al nodo entero a swap (visto en vivo con # gitea-runner sin límites, ver docs-portal del lab). resources: requests: cpu: 50m memory: 64Mi limits: cpu: 500m memory: 512Mi