High Level Amazon EKS
In the above structure we have 2 VPCs (Amazon Virtual Private Cloud), one containing the running Woker Nodes and the other one with the Master Nodes here it is the EKS Control Plane, in more detail we see the following image.
Run an environment on cloud9
First of all I will choose the area needed to create the environment
Visit the following link: https://console.aws.amazon.com/cloud9/home/product
We have a display
Click Create Environment
Enter the environment name. And Next Step
In the next step, we will leave the default of Free Tier t2.micro and Create environment
This is our environment =)) has the same interface as the IDE.
Install Kubernetes
We will select New Terminal to create a terminal to install
Install kubectl
1 2 | sudo curl --silent --location -o /usr/local/bin/kubectl https://amazon-eks.s3-us-west-2.amazonaws.com/1.14.6/2019-08-22/bin/linux/amd64/kubectl |
1 2 | sudo chmod +x /usr/local/bin/kubectl |
Install jq, envsubst (from GNU gettext utilities) and bash-completion
1 2 | sudo yum -y install jq gettext bash-completion |
Enable kubectl bash_completion
1 2 3 4 | kubectl completion bash >> ~/.bash_completion . /etc/profile.d/bash_completion.sh . ~/.bash_completion |
Create IAM ROLE for Workspace
Access to IAM
Create Role
Make sure to select AdministratorAccess
Then Next: Review
I will set the Role Name to: eks-admin
Authorize IAM for Workspace
Visit the EC2 page for instances
Select Attach / Replace IAM Role
Select the eks-admin you created
Config AWS CLI with its region
1 2 3 | export ACCOUNT_ID=$(aws sts get-caller-identity --output text --query Account) export AWS_REGION=$(curl -s 169.254.169.254/latest/dynamic/instance-identity/document | jq -r '.region') |
Save that information to bash_profile
1 2 3 4 5 | echo "export ACCOUNT_ID=${ACCOUNT_ID}" | tee -a ~/.bash_profile echo "export AWS_REGION=${AWS_REGION}" | tee -a ~/.bash_profile aws configure set default.region ${AWS_REGION} aws configure get default.region |
Check out IAM Role
1 2 | aws sts get-caller-identity |
will show results:
1 2 3 4 5 6 | { "Account": "243148885372", "UserId": "AROATRHGNRV6EL6JDSTFH:i-03396afa59aea6e90", "Arn": "arn:aws:sts::243148885372:assumed-role/eks-admin/i-03396afa59aea6e90" } |
eks-admin has been granted permission to this environment
Next
We will install eksctl and create the cluster.