Add Vault-scoped agent kubernetes roles + agents AppRole #109
Reference in New Issue
Block a user
Delete Branch "benvin/agent-kube-contexts"
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
Agentic workloads currently need cluster-admin/root kubeconfig contexts to do routine per-domain work. This adds domain-scoped, Vault-issued kubernetes credentials plus an
agentsAppRole so agents get least-privilege access instead of escalating.Changes
kubernetes_secret_backend_roleconfigsagent-dhcp,agent-dns,agent-certs,agent-storage(au/syd1):dhcp-system): full verbs onkea.unkin.netCRDs; get/list/watch pods/services/configmaps/events + pods/log.service_account_namemode): mints tokens for the staticagent-dnsSA (argocd-apps#332) whose per-namespace RoleBindings confine access to bind-system/bind-internal/bind-external/externaldns.allowed_kubernetes_namespaces: [bind-system](the SA's namespace).cert-manager): full verbs oncert-manager.io+acme.cert-manager.io(closes the orders/challenges debugging gap); get/list/watch/delete secrets; get/list/watch pods + pods/log. Secret delete confined tocert-manager.cephrgw-system): full verbs onceph.unkin.netCRDs (buckets/bucketaccesses/objectstoreusers); get/list/watch pods + pods/log.kubernetes_secret_backend_rolemodule with an optionalservice_account_name; when set,generated_role_rules/kubernetes_role_typeare omitted (the SA's own bindings supply RBAC).kubernetes_au_syd1_cluster_operatorldap group (human kubectl use) and theagentsAppRole (programmatic use).agentsAppRole (mirrors the certmanager approle schema):bind_secret_id: false(role_id-only login),token_bound_cidrs: [10.10.12.200/32](agent workstation wg0 addr), deterministic role_id, 1h/4h TTLs.policies/kv/kubernetes/agents.yamlgranting the AppRole create/read/update/list onkv/data/kubernetes/*+ read/list onkv/metadata/kubernetes/*(no delete).Ordering
argocd-apps#332 (the
agent-dnsSA + ClusterRole + per-namespace RoleBindings) must sync before theagent-dnscreds here are usable — Vault mints tokens for a service account that must already exist.https://claude.ai/code/session_01JUoARVdmhxKQHyyyp1pxeT