apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: flagger
rules:
  - apiGroups:
      - ""
    resources:
      - events
      - configmaps
      - configmaps/finalizers
      - secrets
      - secrets/finalizers
      - services
      - services/finalizers
    verbs:
      - get
      - list
      - watch
      - create
      - update
      - patch
      - delete
  - apiGroups:
      - "coordination.k8s.io"
    resources:
      - leases
    verbs:
      - get
      - list
      - watch
      - create
      - update
      - patch
      - delete
  - apiGroups:
      - apps
    resources:
      - daemonsets
      - daemonsets/finalizers
      - deployments
      - deployments/finalizers
    verbs:
      - get
      - list
      - watch
      - create
      - update
      - patch
      - delete
  - apiGroups:
      - autoscaling
    resources:
      - horizontalpodautoscalers
      - horizontalpodautoscalers/finalizers
    verbs:
      - get
      - list
      - watch
      - create
      - update
      - patch
      - delete
  - apiGroups:
      - extensions
      - networking.k8s.io
    resources:
      - ingresses
      - ingresses/finalizers
    verbs:
      - get
      - list
      - watch
      - create
      - update
      - patch
      - delete
  - apiGroups:
      - flagger.app
    resources:
      - canaries
      - canaries/status
      - canaries/finalizers
      - metrictemplates
      - metrictemplates/status
      - alertproviders
      - alertproviders/status
    verbs:
      - get
      - list
      - watch
      - create
      - update
      - patch
      - delete
  - apiGroups:
      - networking.istio.io
    resources:
      - virtualservices
      - virtualservices/finalizers
      - destinationrules
      - destinationrules/finalizers
    verbs:
      - get
      - list
      - watch
      - create
      - update
      - patch
      - delete
  - apiGroups:
      - appmesh.k8s.aws
    resources:
      - virtualnodes
      - virtualnodes/finalizers
      - virtualrouters
      - virtualrouters/finalizers
      - virtualservices
      - virtualservices/finalizers
    verbs:
      - get
      - list
      - watch
      - create
      - update
      - patch
      - delete
  - apiGroups:
      - split.smi-spec.io
    resources:
      - trafficsplits
      - trafficsplits/finalizers
    verbs:
      - get
      - list
      - watch
      - create
      - update
      - patch
      - delete
  - apiGroups:
      - specs.smi-spec.io
    resources:
      - httproutegroups
      - httproutegroups/finalizers
    verbs:
      - get
      - list
      - watch
      - create
      - update
      - patch
      - delete
  - apiGroups:
      - gloo.solo.io
    resources:
      - upstreams
      - upstreams/finalizers
    verbs:
      - get
      - list
      - watch
      - create
      - update
      - patch
      - delete
  - apiGroups:
      - gateway.solo.io
    resources:
      - routetables
      - routetables/finalizers
    verbs:
      - get
      - list
      - watch
      - create
      - update
      - patch
      - delete
  - apiGroups:
      - projectcontour.io
    resources:
      - httpproxies
      - httpproxies/finalizers
    verbs:
      - get
      - list
      - watch
      - create
      - update
      - patch
      - delete
  - apiGroups:
      - kuma.io
    resources:
      - trafficroutes
      - trafficroutes/finalizers
    verbs:
      - get
      - list
      - watch
      - create
      - update
      - patch
      - delete
  - apiGroups:
      - gateway.networking.k8s.io
    resources:
      - httproutes
      - httproutes/finalizers
    verbs:
      - get
      - list
      - watch
      - create
      - update
      - patch
      - delete
  - nonResourceURLs:
      - /version
    verbs:
      - get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: flagger
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: flagger
subjects:
- kind: ServiceAccount
  name: flagger
  namespace: flagger-system
