add agent-observability service account and namespace-scoped RBAC
ci/woodpecker/pr/vector-test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/kubeconform Pipeline was successful

This commit is contained in:
2026-09-27 00:38:38 +10:00
parent 757ae5b240
commit d4a39c44e6
6 changed files with 85 additions and 0 deletions
@@ -0,0 +1,16 @@
---
# Confines the agent-observability service account (in vm-system) to the
# agent-observability ClusterRole within this namespace.
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: agent-observability
namespace: logging
subjects:
- kind: ServiceAccount
name: agent-observability
namespace: vm-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: agent-observability
+1
View File
@@ -17,6 +17,7 @@ resources:
- configmap_logarchiver.yaml
- deployment_logarchiver.yaml
- logviewer
- agent-observability-rolebinding.yaml
# Vector pipelines are the single source of truth (also validated by
# `vector test` in CI). Mounted into each tier via `existingConfigMaps`.
@@ -0,0 +1,16 @@
---
# Confines the agent-observability service account (in vm-system) to the
# agent-observability ClusterRole within this namespace.
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: agent-observability
namespace: observability
subjects:
- kind: ServiceAccount
name: agent-observability
namespace: vm-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: agent-observability
@@ -13,3 +13,4 @@ resources:
- httproute.yaml
- vmpodscrape-cnpg.yaml
- vmpodscrape-traefik.yaml
- agent-observability-rolebinding.yaml
@@ -0,0 +1,50 @@
---
# Static service account that Vault's kubernetes secret engine mints scoped
# tokens for (agent-observability role). RBAC is confined to the metrics and
# logging namespaces via the per-namespace RoleBindings, not a
# ClusterRoleBinding. Workloads and VictoriaMetrics CRs are deliberately
# patch/update only: deleting a VMCluster or VLCluster destroys data.
apiVersion: v1
kind: ServiceAccount
metadata:
name: agent-observability
namespace: vm-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: agent-observability
rules:
- apiGroups: ["operator.victoriametrics.com"]
resources: ["*"]
verbs: ["get", "list", "watch", "create", "patch", "update"]
- apiGroups: ["apps"]
resources: ["deployments", "statefulsets", "daemonsets"]
verbs: ["get", "list", "watch", "patch", "update"]
# delete permits a rolling restart without granting workload deletion.
- 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"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: agent-observability
namespace: vm-system
subjects:
- kind: ServiceAccount
name: agent-observability
namespace: vm-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: agent-observability
+1
View File
@@ -4,3 +4,4 @@ kind: Kustomization
resources:
- namespace.yaml
- agent-observability-rbac.yaml