kubernetes_service_account

A service account provides an identity for processes that run in a Pod.

Read more at Kubernetes reference

Example Usage

resource "kubernetes_service_account" "example" {
  metadata {
    name = "terraform-example"
  }
}

resource "kubernetes_secret" "example" {
  metadata {
    annotations = {
      "kubernetes.io/service-account.name" = kubernetes_service_account.example.metadata.0.name
    }

    generate_name = "terraform-example-"
  }

  type                           = "kubernetes.io/service-account-token"
  wait_for_service_account_token = true
}

Argument Reference

The following arguments are supported:

Nested Blocks

metadata

Arguments

Attributes

image_pull_secret

Arguments

secret

Arguments

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Import

Service account can be imported using the namespace and name, e.g.

$ terraform import kubernetes_service_account.example default/terraform-example