File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed
Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ mkdir -p ${NODES_PATH}
2323NAMESPACE_MANIFEST=" /etc/node-gather/namespace.yaml"
2424SERVICEACCOUNT_MANIFEST=" /etc/node-gather/serviceaccount.yaml"
2525DAEMONSET_MANIFEST=" /etc/node-gather/daemonset.yaml"
26+ CLUSTER_ROLE_MANIFEST=" /etc/node-gather/clusterrole.yaml"
27+ CLUSTER_ROLE_BINDING_MANIFEST=" /etc/node-gather/clusterrolebinding.yaml"
2628NAMESPACE=$( cat /var/run/secrets/kubernetes.io/serviceaccount/namespace)
2729# Once you start the pod, the Kubernetes will set the pod hostname to the name of the pod
2830# https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-hostname-and-subdomain-fields
@@ -38,6 +40,8 @@ sed -i -e "s#MUST_GATHER_IMAGE#$MUST_GATHER_IMAGE#" $DAEMONSET_MANIFEST
3840oc create -f $NAMESPACE_MANIFEST
3941oc create -f $SERVICEACCOUNT_MANIFEST
4042oc adm policy add-scc-to-user privileged -n perf-node-gather -z perf-node-gather
43+ oc create -f $CLUSTER_ROLE_MANIFEST
44+ oc create -f $CLUSTER_ROLE_BINDING_MANIFEST
4145oc create -f $DAEMONSET_MANIFEST
4246
4347COUNTER=0
8892wait " ${ADM_PIDS[@]} "
8993
9094oc delete -f $DAEMONSET_MANIFEST
95+ oc delete -f $CLUSTER_ROLE_BINDING_MANIFEST
96+ oc delete -f $CLUSTER_ROLE_MANIFEST
9197oc delete -f $SERVICEACCOUNT_MANIFEST
9298oc delete -f $NAMESPACE_MANIFEST
Original file line number Diff line number Diff line change 1+ apiVersion : rbac.authorization.k8s.io/v1
2+ kind : ClusterRole
3+ metadata :
4+ name : perf-node-gather-pods-reader
5+ rules :
6+ - apiGroups : [""]
7+ resources : ["pods"]
8+ verbs : ["get","list"]
9+
Original file line number Diff line number Diff line change 1+ apiVersion : rbac.authorization.k8s.io/v1
2+ kind : ClusterRoleBinding
3+ metadata :
4+ name : perf-node-gather-pods-reader
5+ subjects :
6+ - kind : ServiceAccount
7+ name : perf-node-gather
8+ namespace : perf-node-gather
9+ apiGroup : " "
10+ roleRef :
11+ kind : ClusterRole
12+ name : perf-node-gather-pods-reader
13+ apiGroup : rbac.authorization.k8s.io
You can’t perform that action at this time.
0 commit comments