Files
service-catalog/manifests/helm/victoria-metrics-agent/0.40.0/templates/rbac.yaml
T
wbsong111 6290322f1b Add VictoriaMetrics observability stack + sync catalog for monitoring test
- VM stack 10 charts: victoria-metrics-cluster/auth, victoria-logs-cluster,
  victoria-metrics-agent/alert, opentelemetry-collector, kube-state-metrics,
  prometheus-node-exporter, alertmanager, perses (JWT/OIDC, Infisical-ready)
- ArgoCD ApplicationSet (syncWave) + per-chart dip-values overlays
- doc/victoria-metrics-architecture.md, define-chart-resources updates
- includes pending working-tree changes (mlflow, kubeflow, apisix, CLAUDE.md)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 11:10:51 +09:00

72 lines
1.9 KiB
YAML

{{- if .Values.rbac.create -}}
{{- $ctx := dict "helm" . }}
{{- $fullname := include "vm.plain.fullname" $ctx }}
{{- $namespaced := .Values.rbac.namespaced }}
{{- $ns := include "vm.namespace" $ctx }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: {{ ternary "RoleBinding" "ClusterRoleBinding" $namespaced }}
metadata:
name: {{ $fullname }}
{{- if $namespaced }}
namespace: {{ $ns }}
{{- end }}
{{- $_ := set $ctx "extraLabels" .Values.rbac.extraLabels }}
labels: {{ include "vm.labels" $ctx | nindent 4 }}
{{- $_ := unset $ctx "extraLabels" }}
{{- with .Values.rbac.annotations }}
annotations: {{ toYaml . | nindent 4 }}
{{- end }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: {{ ternary "Role" "ClusterRole" $namespaced }}
name: {{ $fullname }}
subjects:
- kind: ServiceAccount
name: {{ (.Values.serviceAccount).name | default $fullname }}
namespace: {{ $ns }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: {{ ternary "Role" "ClusterRole" $namespaced }}
metadata:
name: {{ $fullname }}
{{- if $namespaced }}
namespace: {{ include "vm.namespace" $ctx }}
{{- end }}
{{- $_ := set $ctx "extraLabels" .Values.rbac.extraLabels }}
labels: {{ include "vm.labels" $ctx | nindent 4 }}
{{- $_ := unset $ctx "extraLabels" }}
{{- with .Values.rbac.annotations }}
annotations: {{ toYaml . | nindent 4 }}
{{- end }}
rules:
- apiGroups:
- discovery.k8s.io
resources:
- endpointslices
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources:
- services
- endpoints
- pods
verbs: ["get", "list", "watch"]
- apiGroups:
- networking.k8s.io
resources:
- ingresses
verbs: ["get", "list", "watch"]
{{- with .Values.rbac.extraRules }}
{{ toYaml . }}
{{- end }}
{{- if not $namespaced }}
- apiGroups: [""]
resources:
- nodes
- nodes/metrics
verbs: ["get", "list", "watch"]
- nonResourceURLs: {{ toYaml .Values.allowedMetricsEndpoints | nindent 2 }}
verbs: ["get"]
{{- end }}
{{- end -}}