Installing the AWS CLI, kubectl and eksctl on macOS
Overview Working with Amazon Elastic Kubernetes Service (EKS) from a Mac takes three command-line tools, and they build on each other in the order below: AWS CLI — authenticates you to AWS and is the tool every later step relies on for credentials and identity. kubectl — the standard Kubernetes client, used to talk to the API server of an EKS cluster once one exists. eksctl — a higher-level tool…
The Amazon Elastic Kubernetes Service (EKS) can be managed from a macOS using three command-line tools: AWS CLI, kubectl, and eksctl. These tools build on each other, with AWS CLI authenticating the user, kubectl interacting with the EKS cluster API server, and eksctl creating and managing EKS clusters.
The AWS CLI requires the creation of an access key for the IAM user being used. This access key should be stored securely as it cannot be retrieved once it's been shown. It is recommended to use a dedicated, least-privilege IAM user or IAM Identity Center / SSO sessions where available, and to rotate keys regularly.
The AWS CLI can be installed on macOS using a signed installer package, or it can be updated using the existing package. To verify the installation, check that the AWS CLI binary is on the system's $PATH and that it reports a version number. The AWS credentials can then be configured using the aws configure command, which stores the access key, secret key, default region, and output format in the ~/.aws/credentials and ~/.aws/config files.
Once the AWS CLI is set up, kubectl must be installed to interact with the EKS cluster. The kubectl binary for the desired Kubernetes version must be downloaded from the Amazon EKS S3 bucket and made executable, then added to the user's $PATH. It's recommended to place kubectl in a per-user directory ahead of other installations to ensure it takes precedence.
Finally, eksctl can be installed via Homebrew, a package manager for macOS. eksctl creates EKS clusters by provisioning CloudFormation stacks, so the IAM user performing the installation needs the necessary permissions. After installing eksctl, verify its version to ensure it matches the desired Kubernetes version.
With all three tools installed and configured, the usual next step is to create an EKS cluster using eksctl. This command writes the cluster's connection details into the kubeconfig, allowing kubectl to communicate with the cluster.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.