aws eks get-token

From wikieduonline
Revision as of 18:52, 12 February 2024 by Welcome (talk | contribs) (→‎Errors)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

aws eks get-token [1] get a token for authentication with an Amazon EKS cluster. This can be used as an alternative to the aws-iam-authenticator.

Examples[edit]

aws eks get-token --cluster-name  your-cluster-name.eu-central-1.eksctl.io
{"kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "spec": {}, "status": {"expirationTimestamp": "2022-07-28T14:31:47Z", "token": "k8s-aws-v1.aHR0cHM6Ly9zdHMuZXUtY2VudHJhbC0xLmFtYXpvbmLVNpZ25lZEhlYWRlcnM9aG9zdCUzQngtazhzLWF3cy1pZCZYLUFtei1TaWduYXR1cmU9OGU3OWNmMGI4ZTMzMjQxMzk4OGRlZjViYWNhZGEyMDNkYjE5NzM0ZjBiZGYwMjEwMjRlYTRkYjMzMGExMTZiYw"}}

Terraform[edit]

 provider "kubernetes" {
  host                   = var.cluster_endpoint
  cluster_ca_certificate = base64decode(var.cluster_ca_cert)
  exec {
    api_version = "client.authentication.k8s.io/v1alpha1"
    args        = ["eks", "get-token", "--cluster-name", var.cluster_name]
    command     = "aws"
  }
}

Related[edit]

Errors[edit]

See also[edit]

  • https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/get-token.html
  • Advertising: