Run this command in your terminal:
aws --version
Then proceed according to your output:
aws-cli version >= 1.16
aws-cli/1.18.68 Python/3.7.6 Darwin/19.6.0 botocore/1.16.18
aws-cli version < 1.16
aws-cli/1.15.68 Python/3.7.6 Darwin/19.6.0 botocore/1.16.18
Error
No such command
Run this command in your terminal:
aws sts get-caller-identity
Then proceed according to your output:
Success
{
  "UserId": "AWSIDAWSIDAWSID",
  "Account": "",
  "Arn": "arn:aws:iam:::user/Name"
}
Error
The config profile could not be found
Run this command in your terminal:
aws-iam-authenticator version
Then proceed according to your output:
Success
{
  "Version" : "v0.5.2",
  "Commit" : "292b9b82df69b87af962b92485b254d9f4b10f00"
}
Error
command not found: aws-iam-authenticator
Run this command in your terminal:
aws eks get-token --cluster-name
Then proceed according to your output:
Success
{
  "kind": "ExecCredential",
  "apiVersion": "client.authentication.k8s.io/v1alpha1",
  "spec":
  {},
  "status":
  {
    "expirationTimestamp": "2020-11-05T13:32:44Z",
    "token": "k8s-aws-v1.LONG_ACCESS_TOKEN"
  }
}
Error
access denied
Run this command in your terminal:
kubectl version
Then proceed according to your output:
Success
Client Version: version.Info { Major: "1", Minor: "18", GitVersion: "v1.18.0", GitCommit: "9e991415386e4cf155a24b1da15becaa390438d8", GitTreeState: "clean", BuildDate: "2020-03-25T14:58:59Z", GoVersion: "go1.13.8", Compiler: "gc", Platform: "darwin/amd64" }
Server Version: version.Info { Major: "1", Minor: "16+", GitVersion: "v1.16.13-eks-2ba888", GitCommit: "2ba888155c7f8093a1bc06e3336333fbdb27b3da", GitTreeState: "clean", BuildDate: "2020-07-17T18:48:53Z", GoVersion: "go1.13.9", Compiler: "gc", Platform: "linux/amd64" }
Error
command not found: kubectl
Run this command in your terminal:
aws eks --region update-kubeconfig --name
Then proceed according to your output:
Success
Added new context arn:aws:eks:::cluster/ to /Users/Name/.kube/config
Error
An error occured
Run this command in your terminal:
kubectl get pods
Then proceed according to your output:
Success
NAME READY STATUS RESTARTS AGE
hello-node 1/1 Running 0 43s
Error
An error occured
Forbidden
Error from server (Forbidden): pods is forbidden: User "Name" cannot list resource "pods" in API group "" in the namespace "default"
Unauthorized
error: You must be logged in to the server (Unauthorized)
Set up the AWS CLI:
Before you can proceed, you must set up the AWS Command Line Utility (CLI) in order to access the Kubernetes Cluster. This requires an AWS identity with the appropriate permissions; if you do not have this, contact your AWS administrator.

To set up the AWS CLI, please refer to these resources:
  • The AWS official walkthrough: here
  • This simpler Cloud Academy walkthrough: here
  • Any other walkthrough you find on Google.

Make sure you follow the correct instructions for your machine. Continue once you have the CLI installed.

Installed
Update the AWS CLI:
Accessing an Amazon Kubernetes cluster requires the AWS Command Line Interface (CLI) at version 1.16 or greater. If you are using an older version, you are required to upgrade before proceeding. Version 1.X is the original AWS CLI, which you currently use. Amazon has subsequently released Version 2 of the CLI, which they recommend. However, there are some breaking changes. You may choose either major version, but must upgrade to version 1.16 or greater.

To upgrade the AWS CLI, please refer to these resources:
  • The AWS official walkthrough to upgrade your Version 1: here
  • The AWS official walkthrough to upgrade to Version 2: here
  • Any other walkthrough you find on Google.

Make sure you follow the correct instructions for your machine. Continue once you have finished the installation.

Upgraded
Get an Identity
Accessing AWS resources requires a valid AWS identity set up on your machine. The previous command checked for that. If this gives you an error, you either do not have a valid identity, have not properly linked it to your machine, or have an issue with the AWS CLI.

You will need to fix this error before proceeding. If needed, please contact your AWS administrator with the error code for assistance.

Fixed
Installing the aws-iam-authenticator
You are going to be authenticating yourself to Kubernetes using your Amazon IAM identity. In order for Kubernetes to recognize this as valid, you need the aws-iam-authenticator as a go-between.

To install the aws-iam-authenticator, please refer to these resources:
  • The AWS official walkthrough: here
  • The Kubernetes GitHub walkthrough: here
  • Any other walkthrough you find on Google.

Make sure you follow the correct instructions for your machine. Continue once you have finished the installation.

Installed
Resolve get-token
Amazon uses the get-token subroutine in order to verify your identity for cluster access.

You will need to fix this error before proceeding. Please contact your AWS administrator with the error code for assistance.

Fixed
Installing Kubectl
You will communicate with the Amazon Kubernetes cluster using the kubectl command line tool. There are a lot of resources available for this, as it is the primary way of interacting with any Kubernetes cluster, not just the AWS one.

Feel free to install your own local Kubernetes cluster if you wish to have your own testing sandbox to explore. I recommend minikube. This is unnecessary but will give you more freedom to learn, as access to the AWS cluster may be restricted.

To install the kubectl, please refer to these resources:
  • The AWS official walkthrough: here
  • The Kubernetes official walkthrough: here (Recommended)
  • Any other walkthrough you find on Google. You will be able to find a lot more for this since it's not Amazon-specific, so look around for whatever tutorial best suits you.

Make sure you follow the correct instructions for your machine. Continue once you have finished the installation.

Installed
Add Cluster
This command is required to link your local kubectl to the AWS cluster. Please return to the start and verify that all previous commands have succeeded.

If this fails a second time, please contact both your AWS administrator and your Kubernetes administrator with the error code.

Verify
Well Done!
Congratulations! You have successfully accessed the cluster! This message indicates that you have properly set up your configuration, and there's nothing left to be done on your side.

The error message indicates that you do not have access to the cluster, either because the administrator has not added your details correctly or because you do not have permission for this action.

To resolve this, you will need to contact your Kubernetes administrator. To get it fixed quickly, send them these commands and outputs:

kubectl get pods
kubectl config get-contexts
kubectl config view --minify
aws sts get-caller-identity


Success
Different error
If you're faced with a different error, please contact your Kubernetes administrator and proceed after it's resolved

Fixed
Congratulations!!
You have successfully installed kubectl and connected it to the Amazon cluster!

You're done with this walkthrough.
Welcome!
This guide will walk you through the steps neccessary to get access to our Amazon EKS Kubernetes cluster on your local machine.

While you'll be directed to other tutorials for most of the distinct installation directions, this guide is intended to make sure you've installed all the dependencies in the correct order. It's mostly a collection of Amazon tutorials, but let's face it, those are far from straightforward. This should give you a clear guide to the necessary steps, while checking that you meet all requirements for the set-up to proceed smoothly, and providing easy debugging for any issues. By the end, you will have access to our cluster.

This works by providing you with verification commands to run. If the command succeeds, you will continue to the next step. If it fails, you'll see how to fix it. Each command comes with examples of the success and failure states. Please note that your results may vary from these examples, especially if you're not using Mac. However, you should get the general idea. When in doubt, assume it failed.

Get started!