How Do You Use Amazon Elastic Kubernetes Service with the CLI?

Problem scenario
You want to deploy Kubernetes to AWS.  How do you use Amazon EKS to create a cluster with the AWS CLI?

Solution
Prerequisites

i.  This assumes that your AWS CLI has been installed.  If you need assistance with this, see this posting.
ii.  This assumes that you have a role created.  If you need assistance with this, see this posting.

How Do You Create an AWS User with Web Console Access to View EKS Clusters in the AWS Console?

One of the following problem scenarios apply.

Problem scenario #1
You want an AWS user to be able to log into the web console and view EKS clusters.  How do you do this?

OR

Problem scenario #2
You are using AWS and when you log into the AWS Console via a web browser with a user who is a member of a Group with two EKS policies,

How Do You Use Amazon Elastic Kubernetes Service with the Web UI?

Problem scenario
You want to deploy a Kubernetes cluster in AWS.  How do you use Amazon EKS with the web UI?

Solution
Prerequisites

i.  Optional:  It is recommended to create a separate VPC for each cluster (according to Amazon’s documentation here).  If you need to create a VPC, see this posting.

ii.  You need a Linux server with kubectl installed on it. 

How Do You Create a config File for Kubernetes Manually?

Problem scenario
You want to manually create a config file for Kubernetes.  (You do not want to run aws eks update-kubeconfig –name foobar.)  How do you do this?

Solution
These directions are most suited for Amazon EKS.  But they could be adapted for clusters running in other environments (not just AWS).  If you are using GCP, go to the very bottom of the directions and skip the rest.

How Do You Troubleshoot the AWS CLI Error “Traceback … import pkg_resources”?

Problem scenario
You run an “aws” command but you receive an error message such as this:

Traceback (most recent call last):
  File “/usr/bin/aws”, line 4, in <module>
    import pkg_resources
  File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 3007, in <module>

What should you do?

Solution
1.  Install pip.  If you need assistance, see this posting (especially the “Problem scenario” paragraph with hyperlinks based on distribution families of Linux).

How Do You Create an IAM User Account in AWS to Run AWS CLI Commands and Log into the AWS Web UI to Manage EKS?

Problem scenario
You want to use Amazon EKS.  You tried to run an “aws eks” command but got an error about the root user not being allowed to perform the operation.  How do you create an IAM user account in AWS to run AWS CLI commands for EKS and log into the AWS web UI and view EKS clusters?

Solution
Prerequisite

This assumes you have a group that has the correct policies to enable EKS manipulation. 

How Do You Create a Group for AWS Users That Can Manage a Kubernetes Cluster Running in AWS?

Problem scenario
You use EKS to create a Kubernetes cluster.  How do you create a group for AWS user accounts to enable them to manage Kubernetes clusters in AWS?

Solution
1.  Log into the AWS web console.
2.  Go here: https://console.aws.amazon.com/iam/home?
3.  Go to Groups on the left.
4.  Click the “Create New Group” button.
5.  Enter a name (e.g., coolgroup).
6. 

How Do You Create an IAM User Account in AWS to Run AWS CLI Commands and Log into the AWS Web UI?

Problem scenario
How do you create an AWS user that can run AWS CLI commands and log into the AWS web console?

Solution
1.  Log into the AWS web console.
2.  Go here: https://console.aws.amazon.com/iam/home?
3.  Go to Users on the left.
4.  Click the “Add User” button.
5.  Enter a name (e.g., jdoe).  
6.  Check the boxes for both “Programmatic access” and “AWS Management Console access”.

How Do You Create an Amazon Resource Name Role in AWS?

Problem scenario
You want to create an ARN Role in AWS.  What do you do?

Solution
1.  Log into the AWS web console and go here:  https://console.aws.amazon.com/iam/home?#/roles
2.  Click “Create role” (a blue button).  
3.  The type of trusted entity (at the top) should be “AWS Service” (a button like option near the top).  
4.  Click the hyperlink that you desire.  (For a role to that will create Kubernetes clusters,