Back to feed
Dev.to
Dev.to
7/13/2026
Create a Kubernetes service account and assign permissions

Create a Kubernetes service account and assign permissions

Short summary

A tutorial on creating Kubernetes ServiceAccounts and assigning RBAC permissions following the principle of least privilege. Covers creating a ServiceAccount, binding it to a Role with specific verbs (get, list, watch) on defined resources, and verifying permissions with kubectl auth can-i. The context is enabling the Agentic CLI to authenticate with an AKS cluster in cluster mode.

  • Create a ServiceAccount and reference it in a Pod spec via serviceAccountName
  • Assign namespace-scoped permissions using Role + RoleBinding with specific resources and verbs
  • Verify permissions with kubectl auth can-i and avoid granting cluster-admin privileges

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more