Add agent-observability kubernetes creds role and policy (#156)
ci/woodpecker/push/apply Pipeline was successful

No agent Vault role covers the VictoriaMetrics/VictoriaLogs stack, so a scoped Kubernetes token cannot be issued for it and writes there fall back to an admin context.

- add the agent-observability kubernetes secret backend role, allowed in vm-system, observability and logging
- add its generated role rules: read plus patch/update on VictoriaMetrics CRs and workloads, pod delete for rolling restarts, read-only on services, configmaps, endpoints, events and Gateway API routes
- add a policy granting update on kubernetes/au/syd1/creds/agent-observability to the cluster_operator LDAP group and the agents approle

Reviewed-on: #156
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
This commit was merged in pull request #156.
This commit is contained in:
2026-09-27 11:23:36 +10:00
committed by BenVincent
parent 563b2164c7
commit 2ec552d6fd
3 changed files with 80 additions and 0 deletions
@@ -0,0 +1,6 @@
allowed_kubernetes_namespaces:
- "vm-system"
- "observability"
- "logging"
kubernetes_role_type: "Role"
extra_labels: {}
@@ -0,0 +1,12 @@
# Allow access to agent-observability Kubernetes credentials
---
rules:
- path: "kubernetes/au/syd1/creds/agent-observability"
capabilities:
- update
auth:
ldap:
- kubernetes_au_syd1_cluster_operator
approle:
- agents
@@ -0,0 +1,62 @@
---
rules:
# Verbs are listed explicitly rather than "*": delete on a VLCluster reclaims
# its cephrbd-fast-delete PVCs, destroying the log store.
- apiGroups:
- "operator.victoriametrics.com"
resources:
- "*"
verbs:
- "get"
- "list"
- "watch"
- "create"
- "patch"
- "update"
- apiGroups:
- "apps"
resources:
- "deployments"
- "statefulsets"
- "daemonsets"
verbs:
- "get"
- "list"
- "watch"
- "patch"
- "update"
- apiGroups:
- ""
resources:
- "pods"
verbs:
- "get"
- "list"
- "watch"
- "delete"
- apiGroups:
- ""
resources:
- "pods/log"
verbs:
- "get"
- apiGroups:
- ""
resources:
- "services"
- "configmaps"
- "endpoints"
- "events"
verbs:
- "get"
- "list"
- "watch"
- apiGroups:
- "gateway.networking.k8s.io"
resources:
- "gateways"
- "httproutes"
verbs:
- "get"
- "list"
- "watch"