Running k8s on EKS
EKS is the new AWS managed Service for Kubernetes launched at last Re-Invent 2018. EKS is not available in all regions right now. EKS an option for those who don't want to use KOPS. For this blog post, I will show how to easily set up a kubernetes cluster in AWS using EKS. EKS has some benefits, first of all, is a managed service that you are not locked in since the API is kubernetes based so you can easily migrate to other kubernetes installation or even other kubernetes installation in other cloud vendor or on-premises.
EKS Benefits
Deploying nginx in Kubernetes
Nginx up and running on AWS(Need to enable 80 port SG access)

Nginx AWS ELB Created by EKS and K8s with EKSCTL
K8s Nodes Running on EC2 via EKS and EKSCTL
EKS Benefits
- Managed Service without lock-in (Kubernetes API, specs, kubectl)
- There is no Control Plane management (Multi-AZ, Automatic patches, and updates)
- Secure by Default (Secure and encrypted communications between worker nodes and master)
- Conformant and Compatible (EKS runs certified kubernetes. Compatible with standard k8s envs)
IMHO this is what most of the companies are looking for, in other words, *Serverless*.
The Pain Points
I don't want to paint a rosy picture of EKS like any new technology there are problems such as:
- Poor Documentation - very few docs
- Lack of Observability - It's a kind of black blocks compared with Kops.
- When you do something wrong and har to figure it what you did it wrong.
- Error-Prone - Is very easy to make mistakes(eksctl fix that)
- In a Long Run is more expensive than running on EC2 with Kops
- Alpha APIS is not supported.
It's important to keep in mind that EKS is a very new service and it should get better and the time passes.
Running Kubernetes in EKS using EKSCTL
EKSCTL is a great tool. Written in go, makes eks cluster creatin way less error-prone and many simples to get a cluster up and running. So let's get started! Basically, we will install the AWS Authenticator and EKSCTL them we can create the cluster and deploy nginx in kubernetes after that we can access the nginx application in the browser(before that you will need to enable the SG access for your IP). Them we destroy the cluster.
wget https://amazon-eks.s3-us-west-2.amazonaws.com/1.11.5/2018-12-06/bin/linux/amd64/aws-iam-authenticator
chmod +x aws-iam-authenticator
Install eksctl
curl --silent --location "https://github.com/weaveworks/eksctl/releases/download/latest_release/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp
sudo mv /tmp/eksctl /usr/local/bin
Create a cluster in EKS with eksctl
eksctl create cluster --name deveks --nodes=2 --region=us-west-2 --ssh-public-key=~/.ssh/kp_devpoc_k8s.pub
nginx.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: external-http-nginx-deployment
spec:
selector:
matchLabels:
app: nginx
replicas: 1
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
---
kind: Service
apiVersion: v1
metadata:
name: external-http-nginx-service
spec:
selector:
app: nginx
type: LoadBalancer
ports:
- name: http
port: 80
targetPort: 80
Create nginx application on k8s cluster in eks
kubectl create -f ~/nginx.yaml
Get cluster access via aws cli(alternative - not necessary)
aws eks --region us-west-2 update-kubeconfig --name deveks
kubectl get svc
Creating a cluster
Deploying nginx in Kubernetes
Nginx up and running on AWS(Need to enable 80 port SG access)

Nginx AWS ELB Created by EKS and K8s with EKSCTL
Cheers,
Diego Pacheco