Member-only story

RBAC — Kubernetes

Always learning
4 min readNov 23, 2023

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.

  1. Role
  2. ClusterRole
  3. RoleBinding
  4. 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

--

--

Always learning
Always learning

Written by Always learning

கற்றுக் கொள்ளும் மாணவன்...

No responses yet