Skip to main content

atmos aws eks update-kubeconfig

Purpose

Use this command to download kubeconfig from an EKS cluster and save it to a file.


atmos aws eks-update-kubeconfig --help


atmos aws eks update-kubeconfig [options]

This command executes aws eks update-kubeconfig command to download kubeconfig from an EKS cluster and saves it to a file.

The command can execute aws eks update-kubeconfig in three different ways:

  1. 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.yaml CLI config and context.

For example:

atmos aws eks update-kubeconfig --profile=<profile> --name=<cluster_name>
  1. If component and stack are provided on the command-line, then Atmos executes the command using the atmos.yaml CLI config and stack's context by searching for the following settings:
  • components.helmfile.cluster_name_pattern in the atmos.yaml CLI config (and calculates the --name parameter using the pattern)
  • components.helmfile.helm_aws_profile_pattern in the atmos.yaml CLI config (and calculates the --profile parameter using the pattern)
  • components.helmfile.kubeconfig_path in the atmos.yaml CLI config the variables for the component in the provided stack
  • region from the variables for the component in the stack

For example:

atmos aws eks update-kubeconfig <component> -s <stack>
  1. Combination of the above. Provide a component and a stack, and override other parameters on the command line.

For example:

atmos aws eks update-kubeconfig <component> -s <stack> --kubeconfig=<path_to_kubeconfig> --region=us-east-1

info

Refer to Update kubeconfig for more information

tip

Run atmos aws eks update-kubeconfig --help to see all the available options

Examples

atmos aws eks update-kubeconfig <component> -s <stack>
atmos aws eks update-kubeconfig --profile=<profile> --name=<cluster_name>
atmos aws eks update-kubeconfig <component> -s <stack> --kubeconfig=<path_to_kubeconfig> --region=<region>
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

ArgumentDescriptionRequired
componentAtmos componentno

Flags

FlagDescriptionAliasRequired
--stackAtmos stack-sno
--profileAWS profile to use to authenticate to the EKS clusterno
--role-arnAWS IAM role ARN to use to authenticate to the EKS clusterno
--nameEKS cluster nameno
--regionAWS regionno
--kubeconfigkubeconfig filename to append with the configurationno
--aliasAlias for the cluster context name. Defaults to match cluster ARNno
--dry-runPrint the merged kubeconfig to stdout instead of writing it to the specified fileno
--verbosePrint more detailed output when writing the kubeconfig file, including the appended entriesno