Create & Manage Cluster Kubernetes Using EKS

Rio Wiraldhani
4 min readSep 11, 2021

--

What is AWS ?

Amazon Web Services (AWS) is the world’s most comprehensive and broadly adopted cloud platform, offering over 200 fully featured services from data centers globally. Millions of customers — including the fastest-growing startups, largest enterprises, and leading government agencies are using AWS to lower costs, become more agile, and innovate faster.

What is EKS?

Amazon EKS is a managed service that helps make it easier to run Kubernetes on AWS. Through EKS, organizations can run Kubernetes without installing and operating a Kubernetes control plane or worker nodes. Simply put, EKS is a managed containers-as-a-service (CaaS) that drastically simplifies Kubernetes deployment on AWS.

Lets try build a cluster on aws platfrom:

Topologi:

What should we prepare?

  • IAM role for eks cluster & node group eks
  • VPC & subnet for node group eks
  • Security group for eks & node group
  • Key pair, if you need access to your cluster from public ip

Guide

  • Create Iam role for eks cluster & node group eks
    Go to IAM Dashboard, and then create IAM Role for eks & node group eks
Click Create Role
Choose EKS, EKS Cluster And then click Next: Permissions
Click Next: Tags
You can add tag for the iam role eks cluster, click Nex: Review
Create the cluster role with name ekscluster

Next, we will create a iam role for eks node group. Let’s goo…

Select EC2 and then click Next: Permissions
create iam role with name eksnodegroup

Same like before, but in step attach permission policies we just need to add the above policies

  • VPC & subnet for worker node EKS
    Here list of default subnet from aws,
Az-A : 172.31.16.0/20
Az-B : 172.31.32.0/20
  • Create EKS Cluster
Choose ekscluster for Cluster Service Role, then Next
Choose subnet az-a & az-b, next
next, if you need audit log or something you can enable the fitur
Review & make sure your configure, and then create the cluster.

Wait until the cluster has been created.

  • Access your cluster
export AWS_ACCESS_KEY_ID="xxxx"
export AWS_SECRET_ACCESS_KEY="xxx"
aws eks update-kubeconfig --region {region} --name {eks name}kubectl config use-context {cluster arn}kubectl get nodes -A
kubectl get pods -A
pods status pending, because there are currently no worker nodes in the cluster
check status pods calico controller
  • Create Node Group for EKS Cluster
Click add node group
choose the iam role for eks node group, and then click next
Configuration your node group
Choose subnet for az-a & az-b, next & create the node group

Wait until the node group is created.
Check current status node & pods on cluster

nodes already add to eks cluster
pods already running
  • Lets start, deploy wordpress using helm
helm repo add stable https://charts.helm.sh/stable
helm install stable/wordpress --generate-name
Installed
Already installed and pods is running
  • Check or access wordpress using chrome
login page
after login

If you have a question about this topic, you can dm me.

Thanks

--

--

No responses yet