role.yaml 1013 Bytes
Newer Older
1 2 3 4 5 6 7
{{- if .Values.rbac.create }}
# kubernetes_plugin: Give access to stats endpoints
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: influx:stats:viewer
  labels:
8
    {{- include "telegraf.labels" . | nindent 4 }}
9 10
    rbac.authorization.k8s.io/aggregate-view-telegraf-stats: "true"
rules:
11 12 13
  - apiGroups: ["metrics.k8s.io"]
    resources: ["pods"]
    verbs: ["get", "list", "watch"]
14
  - apiGroups: [""]
15
    resources: ["nodes/proxy", "nodes/stats"]
16
    verbs: ["get", "list", "watch"]
17 18 19 20 21 22 23 24 25 26 27 28 29
---
# Define global role with the default system:aggregate-to-view cluster role and the two rules we just created
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: influx:telegraf
aggregationRule:
  clusterRoleSelectors:
    - matchLabels:
        rbac.authorization.k8s.io/aggregate-view-telegraf-stats: "true"
    - matchLabels:
        rbac.authorization.k8s.io/aggregate-to-view: "true"
rules: [] # Rules are automatically filled in by the controller manager.
30
{{- end }}