Member-only story
Understanding Kubernetes: Part 29 Service Account
3 min readFeb 10, 2025
📢 If you’ve been following our Kubernetes series 2025, welcome back! For new readers, check out Part 28: ClusterRole and ClusterRoleBinding
📖 Not a Medium member? No worries! Here’s the free link: Part 29 — Service Account
Kubernetes Service Account
A Service Account in Kubernetes is used to authenticate Pods and provide them with permissions to access the API server securely. Each Pod runs under a Service Account, which can be assigned specific RBAC (Role-Based Access Control) permissions.
Why Use Service Accounts?
- Secure API Access → Provides authentication for Pods to access the Kubernetes API.
- Fine-Grained Permissions → Grants only necessary permissions using RBAC.
- Workload Identity Management → Helps Pods interact with cloud services securely.
Creating a Service Account
apiVersion: v1
kind: ServiceAccount
metadata:
name: my-service-account
namespace: default
- This creates a Service Account named
my-service-account
in thedefault
namespace.
Assigning a Service Account to a Pod
apiVersion: v1
kind…