---
apiVersion: v1
kind: ServiceAccount
metadata:
  namespace: {{.Namespace}}
  name: network-resources-injector-sa
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: network-resources-injector
rules:
- apiGroups:
  - ""
  - k8s.cni.cncf.io
  - extensions
  - apps
  resources:
  - pods
  - network-attachment-definitions
  - replicationcontrollers
  - replicasets
  - daemonsets
  - statefulsets
  verbs:
  - '*'
- apiGroups:
  - certificates.k8s.io
  resources:
  - certificatesigningrequests
  - certificatesigningrequests/approval
  verbs:
  - '*'
- apiGroups:
  - ""
  resources:
  - secrets
  verbs:
  - '*'
- apiGroups:
  - admissionregistration.k8s.io
  resources:
  - mutatingwebhookconfigurations
  - validatingwebhookconfigurations
  verbs:
  - '*'
- apiGroups:
  - ""
  resources:
  - services
  verbs:
  - '*'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: network-resources-injector-role-binding
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: network-resources-injector
subjects:
- kind: ServiceAccount
  name: network-resources-injector-sa
  namespace: {{.Namespace}}
