add agent-observability service account and namespace-scoped RBAC
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
@@ -4,3 +4,4 @@ kind: Kustomization
|
||||
|
||||
resources:
|
||||
- namespace.yaml
|
||||
- agent-observability-rbac.yaml
|
||||
|
||||
Reference in New Issue
Block a user