---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: openshift-sdn
rules:
- apiGroups: ["network.openshift.io"]
  resources:
  - clusternetworks
  - egressnetworkpolicies
  - hostsubnets
  - netnamespaces
  verbs:
  - get
  - list
  - watch
- apiGroups: [""]
  resources:
  - namespaces
  - endpoints
  - services
  - pods
  verbs:
  - get
  - list
  - watch
- apiGroups: [""]
  resources:
  - nodes
  verbs:
  - get
  - list
  - watch
  - patch
- apiGroups: ["extensions"]
  resources:
  - networkpolicies
  verbs:
  - get
  - list
  - watch
- apiGroups: ["networking.k8s.io"]
  resources:
  - networkpolicies
  verbs:
  - get
  - list
  - watch
- apiGroups: [""]
  resources:
  - events
  verbs:
  - create
  - patch
  - update
- apiGroups: ['authentication.k8s.io']
  resources: ['tokenreviews']
  verbs: ['create']
- apiGroups: ['authorization.k8s.io']
  resources: ['subjectaccessreviews']
  verbs: ['create']

---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: sdn
  namespace: openshift-sdn

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: openshift-sdn
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: openshift-sdn
subjects:
- kind: ServiceAccount
  name: sdn
  namespace: openshift-sdn
