apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: controller
rules:
  - apiGroups:
      - ""
    resources:
      - pods
      - namespaces
      - secrets
      - configmaps
      - endpoints
      - services
      - events
      - serviceaccounts
      - persistentvolumeclaims
    verbs:
      - get
      - list
      - create
      - update
      - delete
      - patch
      - watch
  #- apiGroups:
  #  - extensions
  #  resources:
  #  - deployments
  #  verbs:
  #  - get
  #  - list
  #  - create
  #  - update
  #  - delete
  #  - patch
  #  - watch
  - apiGroups:
      - extensions
    resources:
      - ingresses
    verbs:
      - get
      - list
      - create
      - update
      - delete
      - patch
      - watch
  - apiGroups:
      - apps
    resources:
      - deployments
      - statefulsets
    verbs:
      - get
      - list
      - create
      - update
      - delete
      - patch
      - watch
  - apiGroups:
      - batch
    resources:
      - jobs
    verbs:
      - get
      - list
      - create
      - update
      - delete
      - patch
      - watch
  - apiGroups:
      - networking.k8s.io
    resources:
      - networkpolicies
    verbs:
      - get
      - list
      - create
      - update
      - delete
      - patch
      - watch
  - apiGroups:
      - apiextensions.k8s.io
    resources:
      - customresourcedefinitions
    verbs:
      - get
      - list
      - create
      - update
      - delete
      - patch
      - watch
  - apiGroups:
      - iam.wso2.com
    resources:
      - customresourcedefinitions
      - wso2is
      - userstores
      - '*/status'
    verbs:
      - get
      - list
      - create
      - update
      - delete
      - patch
      - watch
  - apiGroups:
      - networking.istio.io
    resources:
      - envoyfilters
      - gateways
      - virtualservices
      - destinationrules
    verbs:
      - get
      - list
      - create
      - update
      - delete
      - patch
      - watch
  - apiGroups:
      - authentication.istio.io
    resources:
      - policies
    verbs:
      - get
      - list
      - create
      - update
      - delete
      - patch
      - watch
  - apiGroups:
      - serving.knative.dev
    resources:
      - configurations
    verbs:
      - get
      - list
      - create
      - update
      - delete
      - patch
      - watch
  - apiGroups:
      - autoscaling
    resources:
      - horizontalpodautoscalers
    verbs:
      - get
      - list
      - create
      - update
      - delete
      - patch
      - watch