Kubernetes RBAC Operations: Difference between revisions
Jump to navigation
Jump to search
Line 18: | Line 18: | ||
kubectl get clusterrolebindings cluster-admin -o yaml | kubectl get clusterrolebindings cluster-admin -o yaml | ||
=Assigning a Cluster Role to a Service Account= | =Assigning a Cluster Role to a Service Account= |
Revision as of 22:26, 11 September 2019
Internal
List Cluster Roles
kubectl get clusterroles
Get Details about a Specific Cluster Role
kubectl -o yaml get clusterroles cluster-admin
List Cluster Role Bindings
kubectl get clusterrolebindings
Get Details about a Specific Cluster Role Binding
kubectl get clusterrolebindings cluster-admin -o yaml
Assigning a Cluster Role to a Service Account
kubectl apply -f
the following manifest:
apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: blue-default-service-account-cluster-admin roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-admin subjects: - kind: ServiceAccount name: default namespace: blue