---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role

metadata:
  name: nginx-controller

rules:
  - apiGroups:
      - ""
    resources:
      - "namespaces"
    verbs:
      - "get"
  - apiGroups:
      - ""
    resources:
      - "configmaps"
      - "pods"
      - "secrets"
      - "endpoints"
    verbs:
      - "get"
      - "list"
      - "watch"
  - apiGroups:
      - ""
    resources:
      - "services"
    verbs:
      - "get"
      - "list"
      - "update"
      - "watch"
  - apiGroups:
      - "extensions"
      - "networking.k8s.io"
    resources:
      - "ingresses"
    verbs:
      - "get"
      - "list"
      - "watch"
  - apiGroups:
      - "extensions"
      - "networking.k8s.io"
    resources:
      - "ingresses/status"
    verbs:
      - "update"
  - apiGroups:
      - "networking.k8s.io"
    resources:
      - "ingressclasses"
    verbs:
      - "get"
      - "list"
      - "watch"
  - apiGroups:
      - ""
    resources:
      - "configmaps"
    resourceNames:
      - "ingress-controller-leader-nginx"
    verbs:
      - "get"
      - "update"
  - apiGroups:
      - ""
    resources:
      - "configmaps"
    verbs:
      - "create"
  - apiGroups:
      - ""
    resources:
      - "endpoints"
    verbs:
      - "create"
      - "get"
      - "update"
  - apiGroups:
      - ""
    resources:
      - "events"
    verbs:
      - "create"
      - "patch"

...
