Add RBAC for termination handler
@@ -11,6 +11,13 @@ metadata:
name: machine-api-controllers
namespace: openshift-machine-api
+---
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+ name: machine-api-termination-handler
+ namespace: openshift-machine-api
+
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
@@ -177,6 +184,21 @@ rules:
resourceNames:
- privileged
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: Role
+metadata:
+ name: machine-api-termination-handler
+ namespace: openshift-machine-api
+rules:
+ - apiGroups:
+ - machine.openshift.io
+ resources:
+ - machines
+ verbs:
+ - list
+ - delete
+
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
@@ -202,6 +224,7 @@ rules:
- apps
resources:
- deployments
+ - daemonsets
verbs:
- get
- list
@@ -329,6 +352,21 @@ subjects:
name: machine-api-controllers
namespace: openshift-machine-api
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: RoleBinding
+metadata:
+ name: machine-api-termination-handler
+ namespace: openshift-machine-api
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: Role
+ name: machine-api-termination-handler
+subjects:
+ - kind: ServiceAccount
+ name: machine-api-termination-handler
+ namespace: openshift-machine-api
+
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
