cancel
Showing results for 
Search instead for 
Did you mean: 
Richard4
Mission Specialist
Mission Specialist
  • 503 Views

DO380 viewing service accounts attached to clusterroles

Page 39 on the PDF itself from DO380 guide

Say I created below YAML file and ran it. Now I want to add another serviceaccount named "tom" to the clusterrole. The serviceaccount of "Tom" is created.


oc adm policy add-cluster-role-to-user auditor -z tom  (maybe this is not the correct way to do it?)


How do I view the serviceaccount named "Tom" is associated with the clusterrole called "auditor"?

 

apiVersion: v1
kind: ServiceAccount
metadata:
name: auditor
namespace: automation-scripts


---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: auditor
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list"]


---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: auditor
subjects:
- kind: ServiceAccount
name: auditor
namespace: automation-scripts
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: auditor

 

Labels (1)
0 Kudos
0 Replies
Join the discussion
You must log in to join this conversation.