Kubernetes: part 3 – AWS EKS overview and manual EKS cluster set up
Tags: aws, docker, kubernetes, cloud
Published: 2019-08-24 04:20:24

---
title: Kubernetes: part 3 – AWS EKS overview and manual EKS cluster set up
published: true
tags: Aws,Docker,Kubernetes,cloud
canonical_url: https://rtfm.co.ua/en/kubernetes-part-3-aws-eks-overview-and-manual-eks-cluster-set-up/
---

![](https://rtfm.co.ua/wp-content/uploads/2017/06/kuber-1.png)Let’s proceed with our Kubernetes journey.

Previous parts:

- [Kubernetes: part 1 – architecture and main components overview](https://rtfm.co.ua/en/kubernetes-part-1-architecture-and-main-components-overview/)
- [Kubernetes: part 2 – a cluster set up on AWS with AWS cloud-provider and AWS LoadBalancer](https://rtfm.co.ua/en/kubernetes-part-2-a-cluster-set-up-on-aws-with-aws-cloud-provider-and-aws-loadbalancer/)

In this part we will start working with AWS Elastic Kuberneters Service (EKS) – its short overview, then will create Kubernetes Control Plane, CloudFormation stack with Worker Nodes, will spin up a simple web-services and will add a LoadBalancer.

### Elastic Kubernetes Service – an overview

AWS EKS is a Kubernetes cluster where its core – [Control Plane](https://rtfm.co.ua/kubernetes-znakomstvo-chast-1-arxitektura-i-osnovnye-komponenty-obzor/#Kubernetes_core_services_aka_Kubernetes_Control_Plane) – will be managed by AWS itself thus freeing a user from needless headache.

- [Control Plane](https://rtfm.co.ua/kubernetes-znakomstvo-chast-1-arxitektura-i-osnovnye-komponenty-obzor/#Kubernetes_core_services_aka_Kubernetes_Control_Plane): managed by AWS, consists of three EC2 in different Availability Zones
- [Worker Nodes](https://rtfm.co.ua/kubernetes-znakomstvo-chast-1-arxitektura-i-osnovnye-komponenty-obzor/#Worker_Node): a common ЕС2 in AutoScaling group, in a customer’s VPC, managed by the user

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/product-page-diagram-AmazonEKS-v2.dd41321fd3aa0915b93396c13e739351d2160ba8.png "Kubernetes: обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/product-page-diagram-AmazonEKS-v2.dd41321fd3aa0915b93396c13e739351d2160ba8.png)

A network overview:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/wsi-imageoptim-amazon-eks-1.png "Kubernetes: обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/wsi-imageoptim-amazon-eks-1.png)

For networking – the [amazon-vpc-cni-k8s](https://github.com/aws/amazon-vpc-cni-k8s) plugin is used which allows using of AWS ENI (Elastic Network Interface) and a VPC’s network space inside of a cluster.

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/1_c983SnXM_Xo8AjtmXsLi7g.png "Kubernetes: обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/1_c983SnXM_Xo8AjtmXsLi7g.png)

For authorization – the [aws-iam-authenticator](https://docs.aws.amazon.com/eks/latest/userguide/install-aws-iam-authenticator.html) is used which allows authenticating Kubernetes objects against AWS IAM roles and policies (see [Managing Users or IAM Roles for your Cluster](https://docs.aws.amazon.com/en_us/eks/latest/userguide/add-user-role.html))

Also, AWS will manage Kubernetes minor upgrades, i.e. 1.11.5 to 1.11.8, but major upgrades still must be done by a user.

### Preparing AWS environment

To create an EKS cluster firt we need to create a dedicated VPC with subnets, configure routing and add an IAM role for a cluster authorization.

#### IAM role

Go to the _IAM_, create a new role with _EKS_ type:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_104311.png "Kubernetes: обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_104311.png)

_Permissions_ will be filled by AWS itself:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_104333.png "Kubernetes: обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_104333.png)

Save it:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_104454.png "Kubernetes: обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_104454.png)

#### VPC

Next, have to create VPC with 4 subnets – two public for LoadBalacner and two private – for Worker Nodes.

Create a VPC:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_104743.png "Kubernetes: обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_104743.png)

##### SecurityGroup

Go to the _SecurityGroups_, create a new one for the cluster:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_120443.png "Kubernetes: обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_120443.png)

Add desired rules, here just an _Allow All to All_ example:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_120618.png "Kubernetes: обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_120618.png)

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_120535.png "Kubernetes: обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_120535.png)

##### Internet Gateway

Create an IGW which will be used to route traffic from public subnets:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_105012.png "Kubernetes: обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_105012.png)

Attach it to the VPC:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_105044.png "Kubernetes: обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_105044.png)

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_105100.png "Kubernetes: обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_105100.png)

##### Subnets

Pods will use IPs from a subnet allocated (see the [amazon-vpc-cni-k8s](https://github.com/aws/amazon-vpc-cni-k8s)), thus those subnets have to have enough address space.

Create a first public subnet using _10.0.0.0/18 block_ (16384 addresses):

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_104947.png "Kubernetes: обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_104947.png)

A second public subnet using _10.0.64.0/18_ block:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_105307.png "Kubernetes: обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_105307.png)

In public subnets – enable auto-assign public IPs to EC2s:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_111639.png "Kubernetes: обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_111639.png)

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_111718.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_111718.png)

Similarly, add two private subnets:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_105438.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_105438.png)

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_105521.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_105521.png)

##### NAT Gateway

In  a public subnet create a NAT Gateway – it will be used to route traffic from private subnets:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_110149.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_110149.png)

And configure routing here:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_110221.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_110221.png)

##### Route tables

Now, need to create two Route tables – for public and for private subnets.

###### Public route table

Create public subnets route table:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_110418.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_110418.png)

Edit routes – set route to the _0.0.0.0/0_ via IGW created above:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_110507.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_110507.png)

Switch to the _Subnet association_ – attach two public subnets to this RTB:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_110622.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_110622.png)

###### Private route table

In the same way, create RTB for private subnets:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_110714.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_110714.png)

Add another route to the _0.0.0.0/0_ but via NAT GW instead of IGW:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_111009.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_111009.png)

Go back to your subnets – _Edit route table association_:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_111141.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_111141.png)

Attach our private RTB to the private subnets so they will use NAT GW:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_111213.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_111213.png)

Attach our public RTB to the private subnets so they will use Internet GW:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_111259.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_111259.png)

#### Check

To test if this VPC is working – run two EC2 instances.

First in the public subnet:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_111832.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_111832.png)

Set Security Group:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_120808.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_120808.png)

Check networking:

```
[setevoy@setevoy-arch-work ~] $ ssh -i setevoy-testing-eu-west-2.pem ubuntu@35.178.171.252 'ping -c 1 8.8.8.8'
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=51 time=1.33 ms
--- 8.8.8.8 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1.331/1.331/1.331/0.000 ms
```

Add another EC2, in the private subnet:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_112104.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_112104.png)

Do not forget about SG.

And try to ping it from the first instance (as we can’t ping instances in a private networks from the Internet):

```
[setevoy@setevoy-arch-work ~] $ ssh -i setevoy-testing-eu-west-2.pem ubuntu@35.178.171.252 'ping -c 1 10.0.184.21'
PING 10.0.184.21 (10.0.184.21) 56(84) bytes of data.
64 bytes from 10.0.184.21: icmp_seq=1 ttl=64 time=0.357 ms
--- 10.0.184.21 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.357/0.357/0.357/0.000 ms
```

If no reply to the ping – check you Security Groups and Route tables at first.

And we are done here – time to start with EKS itself.

### Elastic Kubernetes Service

#### Create a Control Plane

Go to the EKS and create master-nodes – click the _Create cluster_:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_112630.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_112630.png)

Set name, chose IAM role created at the very beginning:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_112738.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_112738.png)

In subnets chose private subnets only and set SecurityGroup created above:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_112923.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_112923.png)

Enable logs if need:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_121740.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_121740.png)

And create the cluster:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_121802.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_121802.png)

#### Create Worker Nodes

While the Control Plane is in the provisioning state – let’s create a CloudFormation stack for the Worker Nodes.

Can take an existing template from AWS – [https://amazon-eks.s3-us-west-2.amazonaws.com/cloudformation/2019-02-11/amazon-eks-nodegroup.yaml](https://amazon-eks.s3-us-west-2.amazonaws.com/cloudformation/2019-02-11/amazon-eks-nodegroup.yaml).

Go to the _CloudFormation > Create stack_:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_120044.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_120044.png)

As our Worker Nodes will be placed in the private subnets open this template in the Designer:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_122109.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_122109.png)

Find the `AssociatePublicIpAddress` parameter and change its value from the _true_ to _false_:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_122229.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_122229.png)

Click _Create stack_:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_122315.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_122315.png)

Set the stack’s name, can be any, and cluster name – same, as we did it when created Master nodes, e.g. _eks-cluster-manual_ in this example, chose SecurityGroup, fill AutoScale settings:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_122642.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_122642.png)

Find an `NodeImageId` depending on a region (check the [documentation](https://docs.aws.amazon.com/en_us/eks/latest/userguide/getting-started-console.html#eks-launch-workers) for an up-to-date list):

| Region | Amazon EKS-optimized AMI | with GPU support |
| --- | --- | --- |
| US East (Ohio) (`us-east-2`) | `ami-0485258c2d1c3608f` | `ami-0ccac9d9b57864000` |
| US East (N. Virginia) (`us-east-1`) | `ami-0f2e8e5663e16b436` | `ami-0017d945a10387606` |
| US West (Oregon) (`us-west-2`) | `ami-03a55127c613349a7` | `ami-08335952e837d087b` |
| Asia Pacific (Hong Kong) (`ap-east-1`) | `ami-032850771ac6f8ae2` | `N/A*` |
| Asia Pacific (Mumbai) (`ap-south-1`) | `ami-0a9b1c1807b1a40ab` | `ami-005b754faac73f0cc` |
| Asia Pacific (Tokyo) (`ap-northeast-1`) | `ami-0fde798d17145fae1` | `ami-04cf69bbd6c0fae0b` |
| Asia Pacific (Seoul) (`ap-northeast-2`) | `ami-07fd7609df6c8e39b` | `ami-0730e699ed0118737` |
| Asia Pacific (Singapore) (`ap-southeast-1`) | `ami-0361e14efd56a71c7` | `ami-07be5e97a529cd146` |
| Asia Pacific (Sydney) (`ap-southeast-2`) | `ami-0237d87bc27daba65` | `ami-0a2f4c3aeb596aa7e` |
| EU (Frankfurt) (`eu-central-1`) | `ami-0b7127e7a2a38802a` | `ami-0fbbd205f797ecccd` |
| EU (Ireland) (`eu-west-1`) | `ami-00ac2e6b3cb38a9b9` | `ami-0f9571a3e65dc4e20` |
| EU (London) (`eu-west-2`) | `ami-0147919d2ff9a6ad5` | `ami-032348bd69c5dd665` |
| EU (Paris) (`eu-west-3`) | `ami-0537ee9329c1628a2` | `ami-053962359d6859fec` |
| EU (Stockholm) (`eu-north-1`) | `ami-0fd05922165907b85` | `ami-0641def7f02a4cac5` |

Currently, the stack is creating in the London/eu-west-2, no need in GPU, thus – _ami-0147919d2ff9a6ad5_ (Amazon Linux).

Set this AMI ID, select VPC and two subnets:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_122917.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_122917.png)

Click _Next_, skip the next page and click _Create stack_:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_123008.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_123008.png)After the stack creation complete – check the AutoScaling groups:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190815_130331-2.png "Kubernetes: part 3 - AWS EKS overview and manual EKS cluster creation")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190815_130331-2.png)

####  `kubectl` installation

While we were working with the Worker Nodes – our EKS cluster was provisioned and we can install  `kubectl` on a working machine.

Download an executable file:

```
[setevoy@setevoy-arch-work ~] $ curl -o kubectl https://amazon-eks.s3-us-west-2.amazonaws.com/1.13.7/2019-06-11/bin/linux/amd64/kubectl
[setevoy@setevoy-arch-work ~] $ chmod +x kubectl
[setevoy@setevoy-arch-work ~] $ sudo mv kubectl /usr/local/bin/
```

Check:

```
[setevoy@setevoy-arch-work ~] $ kubectl version --short --client
Client Version: v1.13.7-eks-fa4c70
```

To create its config file – use AWS CLI:

```
[setevoy@setevoy-arch-work ~] $ aws eks --region eu-west-2 --profile arseniy update-kubeconfig --name eks-cluster-manual
Added new context arn:aws:eks:eu-west-2:534***385:cluster/eks-cluster-manual to /home/setevoy/.kube/config
```

Add an alias just to make work simpler:

```
[setevoy@setevoy-arch-work ~] $ echo "alias kk="kubectl"" >> ~/.bashrc
[setevoy@setevoy-arch-work ~] $ bash
```

Check it:

```
[setevoy@setevoy-arch-work ~] $ kk get svc
NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
kubernetes   ClusterIP   172.20.0.1   <none>        443/TCP   20m
```

#### AWS authenticator

Although CloudFormation for Worker Nodes already ready, and EC2 instances are up and running – but we still can’t’ see them as Nodes in the Kubernetes cluster:

```
[setevoy@setevoy-arch-work ~] $ kk get node
No resources found.
```

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_123551.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_123551.png)

Download AWS authenticator:

```
[setevoy@setevoy-arch-work ~] $ cd Temp/
[setevoy@setevoy-arch-work ~] $ curl -so aws-auth-cm.yaml https://amazon-eks.s3-us-west-2.amazonaws.com/cloudformation/2019-02-11/aws-auth-cm.yaml
```

Go to the в _IAM  > Roles_, find ARN (Amazon Resource Name) of the role (_NodeInstanceRole_):

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_125008.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_125008.png)

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_125032-1.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_125032-1.png)

Edit file `aws-auth-cm.yaml`, set `rolearn`:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_125128.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_125128.png)

Create a `ConfigMap`:

```
[setevoy@setevoy-arch-work ~/Temp]  $ kk apply -f aws-auth-cm.yaml
configmap/aws-auth created
```

Check it:

```
[setevoy@setevoy-arch-work ~/Temp]  $ kubectl get nodes -o wide
NAME                                         STATUS   ROLES    AGE   VERSION              INTERNAL-IP    EXTERNAL-IP   OS-IMAGE         KERNEL-VERSION                  CONTAINER-RUNTIME

ip-10-0-153-7.eu-west-2.compute.internal     Ready    <none>   47s   v1.13.7-eks-c57ff8   10.0.153.7     <none>        Amazon Linux 2   4.14.128-112.105.amzn2.x86_64   docker://18.6.1

ip-10-0-196-123.eu-west-2.compute.internal   Ready    <none>   50s   v1.13.7-eks-c57ff8   10.0.196.123   <none>        Amazon Linux 2   4.14.128-112.105.amzn2.x86_64   docker://18.6.1

ip-10-0-204-190.eu-west-2.compute.internal   Ready    <none>   52s   v1.13.7-eks-c57ff8   10.0.204.190   <none>        Amazon Linux 2   4.14.128-112.105.amzn2.x86_64   docker://18.6.1
```

Nodes were added to the cluster – great.

### Web-app && LoadBalancer

And for testing purpose – let’s create a simple web-services, for example, a common NGINX, as in the [previous chapter](https://rtfm.co.ua/en/kubernetes-part-2-a-cluster-set-up-on-aws-with-aws-cloud-provider-and-aws-loadbalancer/).

To access NGINX – let’s also create a LoadBalancer in Kubernetes and AWS, which will proxy requests to the Worker Nodes:

```
kind: Service
apiVersion: v1
metadata:
  name: eks-cluster-manual-elb
spec:
  type: LoadBalancer
  selector:
    app: eks-cluster-manual-pod
  ports:
    - name: http
      protocol: TCP
      # ELB's port
      port: 80
      # container's port
      targetPort: 80
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: eks-cluster-manual-deploy
spec:
  # ReplicaSet pods config
  replicas: 1
  # pods selector
  selector:
    matchLabels:
      app: eks-cluster-manual-pod
  # Pod template
  template:
    metadata:
      # a pod's labeles
      labels:
        app: eks-cluster-manual-pod
    spec:
      containers:
        - name: eks-cluster-manual-app
```

Deploy them:

```
[setevoy@setevoy-arch-work ~/Temp]  $ kk apply -f eks-cluster-manual-elb-nginx.yml
service/eks-cluster-manual-elb created
deployment.apps/eks-cluster-manual-deploy created
```

Check services:

```
[setevoy@setevoy-arch-work ~/Temp]  $ kk get svc
NAME                     TYPE           CLUSTER-IP     EXTERNAL-IP                                                               PORT(S)        AGE

eks-cluster-manual-elb   LoadBalancer   172.20.17.42   a05***405.eu-west-2.elb.amazonaws.com   80:32680/TCP   5m23s
```

A Pod:

```
[setevoy@setevoy-arch-work ~/Temp]  kk get po -o wide -l app=eks-cluster-manual-pod

NAME                                         READY   STATUS    RESTARTS   AGE     IP            NODE                                       NOMINATED NODE   READINESS GATES

eks-cluster-manual-deploy-698b8f6df7-jg55x   1/1     Running   0          6m17s   10.0.130.54   ip-10-0-153-7.eu-west-2.compute.internal   <none>           <none>
```

And the `ConfigMap` itself:

```
kubectl describe configmap -n kube-system aws-auth
Name:         aws-auth
Namespace:    kube-system
Labels:       <none>
Annotations:  kubectl.kubernetes.io/last-applied-configuration:
{"apiVersion":"v1","data":{"mapRoles":"- rolearn: arn:aws:iam::534***385:role/eks-cluster-manual-workers-stack-NodeInstanceRole-12DRN98...
Data
====
mapRoles:
----
- rolearn: arn:aws:iam::534***385:role/eks-cluster-manual-workers-stack-NodeInstanceRole-12DRN987QYB34
username: system:node:{{EC2PrivateDNSName}}
groups:
- system:bootstrappers
- system:nodes
Events:  <none>
```

LoadBalancer in the AWS (need to wait about 5 minutes to spin up Pods and attach Nodes to the ELB):

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_131625.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_131625.png)

Its tags:

[![](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_132307.png "Kubernetes: знакомство, часть 3 - обзор AWS EKS и ручное создание кластера")](https://rtfm.co.ua/wp-content/uploads/2019/08/Screenshot_20190813_132307.png)

And test the URL provided by AWS or by `kubectl get svc` command:

```
[setevoy@setevoy-arch-work ~/Temp]  $ curl a05***405.eu-west-2.elb.amazonaws.com
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
...
```

Done.

### Useful links

- [What Is Amazon EKS?](https://docs.aws.amazon.com/en_us/eks/latest/userguide/what-is-eks.html)
- [Getting Started with Amazon EKS](https://docs.aws.amazon.com/en_us/eks/latest/userguide/getting-started-console.html)
- [Managing Users or IAM Roles for your Cluster](https://docs.aws.amazon.com/en_us/eks/latest/userguide/add-user-role.html)
- [Kubernetes ConfigMap](https://unofficial-kubernetes.readthedocs.io/en/latest/tasks/configure-pod-container/configmap/)
- [Amazon EKS Workshop](https://eksworkshop.com/introduction/)
- [Ten things to know about Kubernetes on Amazon (EKS)](https://cloudgeometry.io/blog/amazon-eks/)
- [EKS Review](https://medium.com/@andrewhibbert/eks-review-b4ee523083dc)
- [My First Kubernetes Cluster: A Review of Amazon EKS](https://www.bluematador.com/blog/my-first-kubernetes-cluster-a-review-of-amazon-eks)
- [Troubleshoot Kubernetes Deployments](https://docs.bitnami.com/kubernetes/how-to/troubleshoot-kubernetes-deployments/)
- [matchLabels, labels, and selectors explained in detail, for beginners](https://medium.com/@zwhitchcox/matchlabels-labels-and-selectors-explained-in-detail-for-beginners-d421bdd05362)

### Similar posts

- <small>08/10/2019</small> [Kubernetes: part 2 – a cluster set up on AWS with AWS cloud-provider and AWS LoadBalancer](https://rtfm.co.ua/en/kubernetes-part-2-a-cluster-set-up-on-aws-with-aws-cloud-provider-and-aws-loadbalancer/)
- <small>07/25/2019</small> [Kubernetes: part 1 – architecture and main components overview](https://rtfm.co.ua/en/kubernetes-part-1-architecture-and-main-components-overview/)
- <small>02/21/2019</small> [OpenVPN: OpenVPN Access Server set up and AWS VPC peering configuration](https://rtfm.co.ua/en/openvpn-openvpn-access-server-set-up-and-aws-vpc-peering-configuration/)
- <small>06/13/2018</small> [AWS: CloudFormation – VPC peering и Fn::ImportValue](https://rtfm.co.ua/aws-cloudformation-vpc-peering-i-fnimportvalue/)