apiVersion: v1 kind: ServiceAccount metadata: name: {{ .Release.Name }} labels: {{- include "app.labels" . | nindent 4 }} annotations: # El ServiceAccount se materializa como hook pre-install/pre-upgrade por # PARIDAD con el shape web-backend/python. Este shape NO tiene Job Alembic, # asi que el hook no es estrictamente necesario aqui — pero mantener ambos # charts coherentes reduce la carga cognitiva en debugging y onboarding, y # deja preparado el orden de hooks si en el futuro se agrega un hook que # dependa del SA. Con hook-weight "-5" el SA se aplica antes que cualquier # hook con weight >= 0. "helm.sh/hook": pre-install,pre-upgrade "helm.sh/hook-weight": "-5" # before-hook-creation (NO hook-succeeded): el Deployment de la fase # principal referencia este SA en runtime — debe seguir vivo tras el hook. # before-hook-creation lo borra y recrea solo al inicio del proximo hook, # haciendo el SA-hook idempotente entre upgrades sin dejarlo huerfano. "helm.sh/hook-delete-policy": before-hook-creation