From the course: Certified Kubernetes Administrator (CKA) Cert Prep (2024)

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Setting up role-based access control (RBAC)

Setting up role-based access control (RBAC)

- So in a role-based access control, there are three components that matter. First component is the role. Roles are entities that are used on Namespace, and in roles Verbs are used to specify access to specific resources in that specific Namespace. You can easily use kubectl create role, to create roles. Let me show you. So kubectl create role - h as always. It's showing how to create a role. And this is a pretty nice example because you can also see the syntax. So --verb is get, and resource is pod, and a resource name is readablepod and resource name is anotherpod. That's basically how you create a role. The role is all about the verbs. You can specify one verb, you can specify multiple verbs. So different roles come by default. kubectl get roles. In our situation should give us the leader-locking-nfs-subdir-external-provisioner role. So what's in there? (Instructor typing) As you can see the role definition. So the role definition, in the role definition we have rules. The rule…

Contents