Skip to content

Latest commit

 

History

History
62 lines (54 loc) · 2.04 KB

EKS-Setup.MD

File metadata and controls

62 lines (54 loc) · 2.04 KB

Setup Kubernetes on Amazon EKS

You can follow same procedure in the official AWS document Getting started with Amazon EKS – eksctl

Pre-requisites:

  • an EC2 Instance (Kubernetes Management Host)

  1. Install and setup kubectl on Management host a. Download kubectl version 1.19.6 b. Grant execution permissions to kubectl executable
    c. Move kubectl onto /usr/local/bin
    d. Test that your kubectl installation was successful

    curl -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.19.6/2021-01-05/bin/linux/amd64/kubectl
    chmod +x ./kubectl
    mv ./kubectl /usr/local/bin 
    kubectl version --short --client
  2. Install and setup eksctl on Management Host
    a. Download and extract the latest release
    b. Move the extracted binary to /usr/local/bin
    c. Test that your eksclt installation was successful

    curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp
    sudo mv /tmp/eksctl /usr/local/bin
    eksctl version
  3. Create an IAM Role and attache it to EC2 instance Management Host
    Note: create IAM user with programmatic access if your bootstrap system is outside of AWS
    IAM user should have access to
    IAM
    EC2
    VPC
    CloudFormation

  4. Create EKS cluster and nodes from EC2 Management Host

    eksctl create cluster --name cluster-name  \
    --region region-name \
    --node-type instance-type \
    --nodes-min 2 \
    --nodes-max 2 \ 
    --zones <AZ-1>,<AZ-2>
    
    example:
    eksctl create cluster --name cloudfreak-cluster \
       --region ap-south-1 \
    --node-type t2.medium \
  5. To delete the EKS clsuter

    eksctl delete cluster cloudfreak-cluster --region ap-south-1
  6. Validate your cluster using by creating by checking nodes and by creating a pod

    kubectl get nodes
    kubectl run pod tomcat --image=tomcat