Member-only story
RBAC — Kubernetes
Role-Based Access Control
Role-based access control (RBAC) is an access control method used to restrict access to certain resources in a computer system or network to only authorized users.
It is based on the roles that users have within an organization and the permissions that are associated with those roles.
Kubernetes RBAC API Objects
The RBAC API declares four kinds of Kubernetes objects.
- Role
- ClusterRole
- RoleBinding
- ClusterRoleBinding
RBAC Kubernetes ← Theory
A namespace is a group of related elements that each have a unique name or identifier.
Namespaces provide a method for preventing name conflicts in large projects.
kubectl create ns test
kubectl get ns
Service accounts are used to provide an identity for pods. Pods that want to interact with the API server will authenticate with a particular service account.
Create a serviceaccount.yml file
apiVersion: v1
kind: ServiceAccount
metadata:
name: foo
namespace: test
Apply the file
kubectl apply -f serviceaccount.yml