atmos aws eks update-kubeconfig
Use this command to download kubeconfig from an EKS cluster and save it to a file.
atmos aws eks update-kubeconfig [options]
This command downloads kubeconfig from an EKS cluster and saves it to a file. It supports multiple execution modes:
-
CLI parameters only: If all the required parameters (cluster name and AWS profile/role) are provided on the command-line, then Atmos executes the command without requiring the
atmos.yamlCLI config and context.atmos aws eks update-kubeconfig --profile=<profile> --name=<cluster_name> -
Component and stack: If
componentandstackare provided on the command-line, then Atmos executes the command using theatmos.yamlCLI config and stack's context by searching for the following settings:components.helmfile.cluster_name_patternin theatmos.yamlCLI config (and calculates the--nameparameter using the pattern)components.helmfile.helm_aws_profile_patternin theatmos.yamlCLI config (and calculates the--profileparameter using the pattern)components.helmfile.kubeconfig_pathin theatmos.yamlCLI config the variables for the component in the provided stackregionfrom the variables for the component in the stack
atmos aws eks update-kubeconfig <component> -s <stack> -
Combination: Provide a component and a stack, and override other parameters on the command line.
atmos aws eks update-kubeconfig <component> -s <stack> --kubeconfig=<path_to_kubeconfig> --region=us-east-1 -
Integration mode: Use a named integration from
auth.integrationsto authenticate via the Atmos auth system and generate kubeconfig using the Go SDK (no AWS CLI required).atmos aws eks update-kubeconfig --integration=dev/eks/primary -
Identity mode: Use an Atmos identity directly with explicit cluster parameters. This authenticates via the auth system and uses the Go SDK.
atmos aws eks update-kubeconfig --name=<cluster_name> --region=<region> --identity=<identity_name>
Refer to Update kubeconfig for more information
Run atmos aws eks update-kubeconfig --help to see all the available options
Examples
# Using component and stack
atmos aws eks update-kubeconfig <component> -s <stack>
# Using explicit CLI parameters (requires AWS CLI)
atmos aws eks update-kubeconfig --profile=<profile> --name=<cluster_name>
# Using a named integration (no AWS CLI required)
atmos aws eks update-kubeconfig --integration=dev/eks/primary
# Using an identity with explicit parameters (no AWS CLI required)
atmos aws eks update-kubeconfig --name=dev-cluster --region=us-east-2 --identity=dev-admin
# Override parameters with component and stack
atmos aws eks update-kubeconfig <component> -s <stack> --kubeconfig=<path_to_kubeconfig> --region=<region>
# Additional options
atmos aws eks update-kubeconfig --role-arn <ARN>
atmos aws eks update-kubeconfig --alias <cluster context name alias>
atmos aws eks update-kubeconfig --dry-run=true
atmos aws eks update-kubeconfig --verbose=true
Arguments
component(optional)- Atmos component.
Flags
--stack/-s(optional)- Atmos stack.
--profile(optional)- AWS profile to use to authenticate to the EKS cluster.
--role-arn(optional)- AWS IAM role ARN to use to authenticate to the EKS cluster.
--name(optional)- EKS cluster name.
--region(optional)- AWS region.
--kubeconfig(optional)kubeconfigfilename to append with the configuration.--alias(optional)- Alias for the cluster context name. Defaults to match cluster ARN.
--dry-run(optional)- Print the merged kubeconfig to stdout instead of writing it to the specified file.
--verbose(optional)- Print more detailed output when writing the kubeconfig file, including the appended entries.
--integration(optional)Name of a configured integration from
auth.integrations(must bekind: aws/eks). When specified, Atmos authenticates the integration's linked identity and uses the Go SDK to describe the cluster and generate kubeconfig. This does not require the AWS CLI.--identity(optional)Atmos identity to authenticate with. When used with
--name(and without--profileor--role-arn), Atmos authenticates via the auth system and uses the Go SDK directly. This does not require the AWS CLI.
Configuration
Integration Mode
EKS integrations are configured in atmos.yaml under auth.integrations:
auth:
providers:
company-sso:
kind: aws/iam-identity-center
region: us-east-1
start_url: https://company.awsapps.com/start/
identities:
dev-admin:
kind: aws/permission-set
via:
provider: company-sso
principal:
name: AdministratorAccess
account: dev
integrations:
dev/eks/primary:
kind: aws/eks
via:
identity: dev-admin
spec:
cluster:
name: dev-cluster
region: us-east-2
alias: dev-eks
atmos aws eks update-kubeconfig --integration=dev/eks/primary
See the EKS Kubeconfig Authentication Tutorial for detailed configuration examples.
See Also
- AWS EKS Token Command — Generate EKS bearer tokens for kubectl
- EKS Kubeconfig Authentication Tutorial — Step-by-step EKS setup guide
- Auth Login Command — Authenticate with identities (triggers auto-provisioned integrations)