Connect with kubectl

Add a cluster to your kubeconfig so kubectl signs in with your {{product}} identity, with no secret stored.

Last updated 18 November 2026View as Markdown

Replace my-cluster with your cluster's name or id.

Prerequisites

  • Permission for eks:DescribeCluster on the cluster (to read its endpoint and CA) and eks:AccessKubernetesApi on it (for every token).
  • An access entry on the cluster for you, a group you are in, or the role you act as. See Give someone access.
  • The cluster is active (or updating). Until the first provisioning step has made the cluster's key material, the kubeconfig details answer 409 "The cluster is still being created"; after that they answer, but the endpoint only responds once the control plane is up.
  • The dcloud CLI installed and signed in (dcloud auth login), and kubectl.

Add the cluster to your kubeconfig

  1. Open Kubernetes, then open the cluster.
  2. On Overview, under Connect with kubectl, choose Download kubeconfig.

The file my-cluster.kubeconfig.yaml holds the endpoint and the CA and runs the CLI for every token, so the CLI must be installed and signed in. The button works once the cluster is active or updating.

Result

kubectl asks the CLI for a token on each call (dcloud eks get-token). A token is valid for ten minutes and only for that cluster. Inside the cluster you are ews:<your IAM user name> (or ews:<username> when your access entry sets a username), in the groups of your access policies; see Cluster access.

When the public endpoint is off, server is the endpoint's address in the network, so kubectl must run on a machine in the cluster's network.

Refusals

  • 403 "You have no access entry on my-cluster. Ask someone with eks:CreateAccessEntry to add one."
  • 403 without eks:AccessKubernetesApi on the cluster.
Did this page help you?