Planted .
To create a role in Kubernetes, there are two ways.
- Create the role config in yaml, then run
kubectl create -f - Use the command.
## To create role
kubectl create role pod-reader --verb=get --verb=list --verb=watch --resource=pods
## To create cluster role
kubectl create clusterrole pod-reader --verb=get,list,watch --resource=pods