apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: kiali-viewer
  labels:
    app: kiali
    release: istio
rules:
  - apiGroups: [""]
    resources:
      - configmaps
      - endpoints
      - namespaces
      - nodes
      - pods
      - pods/log
      - replicationcontrollers
      - services
    verbs:
      - get
      - list
      - watch
  - apiGroups: ["extensions", "apps"]
    resources:
      - deployments
      - replicasets
      - statefulsets
    verbs:
      - get
      - list
      - watch
  - apiGroups: ["autoscaling"]
    resources:
      - horizontalpodautoscalers
    verbs:
      - get
      - list
      - watch
  - apiGroups: ["batch"]
    resources:
      - cronjobs
      - jobs
    verbs:
      - get
      - list
      - watch
  - apiGroups: 
    - config.istio.io
    - networking.istio.io
    - authentication.istio.io
    - rbac.istio.io
    - security.istio.io
    resources: ["*"]
    verbs:
      - get
      - list
      - watch
  - apiGroups: ["monitoring.kiali.io"]
    resources:
      - monitoringdashboards
    verbs:
      - get
      - list
