Add ephemeral Gitea creds for repospawner #142
Reference in New Issue
Block a user
Delete Branch "benvin/repospawner-gitea-creds"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
repospawnercreates and seeds Gitea repositories on demand from in-cluster. It needs a Gitea token, and it should not carry a static one -- it gets ephemeral, lease-bound creds like every other service. TheagentsAppRole is CIDR-bound to Ben's workstation, so pods authenticate via Kubernetes auth instead.How
config/gitea_secret_backend_role/gitea/repospawner.yaml-- gitea engine role for therepospawneruser. Scopeswrite:repository,write:issue,read:user(read:useris mandatory: clients validate the login viaGET /api/v1/user, which 403s without it). ttl 1h / max_ttl 4h. Mirrorsunkin-agent.yaml.config/auth_kubernetes_role/k8s/au/syd1/repospawner.yaml-- k8s auth role bound to serviceaccountrepospawnerin namespacerepospawner, 600s ttl,audience: vault(VSO/projected-token flavor, same asmedia-apps/logging_logarchiver).policies/gitea/creds/repospawner.yaml--readongitea/creds/repospawner, bound tok8s/au/syd1: [repospawner]only. Deliberately not bound to theagentsAppRole: the service runs in-cluster only.Depends on
The terraform-git PR that creates the
repospawnerGitea user. The engine role cannot mint creds until the user exists -- merge that one first.