Skip to main content

Service Account

A Service Account in Kubernetes is used to provide an identity for processes that run in a Pod, allowing them to interact with other Kubernetes resources within a namespace. Service Accounts are crucial for managing permissions and access control in Kubernetes deployments. For further details, you can refer to the official Kubernetes ServiceAccount documentation.

Terraform Mappings:

  • kubernetes_service_account.metadata[0].name
  • kubernetes_service_account_v1.metadata[0].name

Supported Methods​

  • GET: Get a ServiceAccount by name
  • LIST: List all ServiceAccounts
  • SEARCH: Search for a ServiceAccount using the ListOptions JSON format e.g. ("labelSelector": "app=wordpress")

Secret​

A Service Account is linked to a Secret in Kubernetes as it holds the credentials for the Service Account, including tokens that are automatically generated. These tokens enable the Service Account to authenticate against the Kubernetes API server, allowing secure communication between the services and resources within the cluster.