Module 07 · DevOps · CI/CD, IaC & Operations · about 15 min to read
Continue where you left off ×
Who may touch the cluster: RBAC, pod security and network policy
Under the Hood · Open board
: one request walking through the cluster’s front door, from the login check to the written record. This lesson is the checks along that walk, and the rules that govern traffic after it.
Before you start. Under the Hood (Kubernetes Internals) showed that every change goes through the API server, which asks three questions in order: who are you, may you do this, and is this change acceptable. The Harbor Master (pods, deployments, services) gave you labels and selectors, the way one object picks out others by the labels they wear. Least Privilege & the 12-Factor App gave you the service account, the login a program uses to talk to the cluster, and kubectl auth can-i, which asks the cluster what an account may do. The cluster that won't sail (Kubernetes troubleshooting) gave you the habit of reading Events, the cluster’s own notes, before changing anything.
The idea in 30 seconds
RBAC only allows. A Role lists verbs on resources, a binding gives the list to an account, and no matching rule means no.
A Role works in one namespace. A ClusterRole covers the whole cluster, unless a RoleBinding scopes it to one namespace.
securityContext is how a pod asks for powers, and Pod Security Standards (Privileged, Baseline, Restricted) are the rules it is judged by.
You switch on a Standard with a label on a namespace, and it checks pods when they are created.
A NetworkPolicy blocks all traffic except what it lists, for the pods it selects, and only works if the network plugin enforces it.
Admission policy checks what is inside a request, such as the replica count, which RBAC cannot see.
Read the story
Lesson 60 of 70 in DevOps
The rest of this lesson is part of a plan.
A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year .
See plans Already a member? Sign in
Or start free : a free account opens lessons 2 and 3 of every track.
In this lesson April 2021: the pod gate that was going away The four gates: who, what shape, who talks, our own rules RBAC: a Role lists the allowed, a binding hands it over Pod Security: securityContext is the setting, the Standard is the rule NetworkPolicy: allowed unless a policy selects the pod Admission policy: our own rules, written as one line Terms it explains: RBAC, Pod Security, NetworkPolicy, Admission policy, Role, RoleBinding, ClusterRole, ClusterRoleBinding, securityContext, Pod Security Standards, Common mistakes, API server, containerd / runc, controller manager.
Review DevOps
Mark as read Saved in this browser, and to your account when you sign in.