Summary
This chapter covered authentication and authorization in Kubernetes. First, we provided an overview of the available authentication methods in Kubernetes and explained how you can use ServiceAccount tokens for external user authentication. Next, we focused on RBAC in Kubernetes. You learned how to use Roles, ClusterRoles, RoleBindings, and ClusterRoleBindings to manage authorization in your cluster. We demonstrated a practical use case of RBAC for ServiceAccounts by creating a Pod that can list Pods in the cluster using the Kubernetes API (respecting the principle of least privilege).
After that, we learned about Admission Controllers in Kubernetes and what controllers are available to secure your Kubernetes cluster. We also learned about SecurityContext and different samples for securityContext configurations. We also discovered how to control traffic flow between Pods by using an object called NetworkPolicy that behaves like a networking firewall within the cluster....