---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: net-attach-def-admission-controller-sa
  namespace: kube-system
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: net-attach-def-admission-controller-role
rules:
- apiGroups: [""]
  resources: ["pods"]
  verbs: ["get", "watch", "list"]
- apiGroups: ["k8s.cni.cncf.io"]
  resources: ["network-attachment-definitions"]
  verbs: ["get", "watch", "list"]

---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: net-attach-def-admission-controller-rolebinding
subjects:
- kind: ServiceAccount
  name: net-attach-def-admission-controller-sa
  apiGroup: ""
  namespace: kube-system
roleRef:
  kind: ClusterRole
  name: net-attach-def-admission-controller-role
  apiGroup: rbac.authorization.k8s.io
