How To Setup or Deploy a Kubernetes Cluster with Amazon EKS


    Install kubectl
    Install aws-iam-authenticator
    step:0 AWS CLI needed to interact with AWS cloud resources. A profile with administrative access should be configured.
    step:1 Create Role (for accessing eks cluster create role with AmazonEKSClusterPolicy and
    AmazonEKSServicePolicy policies)
    Kubernetes clusters managed by Amazon EKS make calls to other AWS services on your behalf to manage the resources that you use with the service. Before you can create Amazon EKS clusters, you must create an IAM role with the following IAM policies:


    Prior to April 16, 2020, AmazonEKSServicePolicy was also required and the suggested name was eksServiceRole. With the AWSServiceRoleForAmazonEKS service-linked role, that policy is no longer required.

    step:2 Create VPC by using Cloudformation template
    step:3 Create Cluster using AWSCLI
    step:4 Update Cluster
    step:5 Create nodes for the cluster using Cloudformation template
    step:6 Map Nodes to Master
    step:7 Check nodes of the cluster

    Download 1.14.6 version of kubectl and aws-iam-authenticator
    CloudFormation will begin to create the VPC. Once done, be sure to note the various values created — SecurityGroups, VpcId and SubnetIds. You will need these in subsequent steps.

    aws eks create-cluster
    –name eks-cluster
    –region us-east-1
    –role-arn arn:aws:iam::791382328408:role/eks-role
    –resources-vpc-config subnetIds=subnet-06e094781818119c9,subnet-02942a18072a8a494,subnet-0d04b795c369cd727,securityGroupIds=sg-047a0533d14aa70bb

    status check for eks cluster
    aws eks –region us-east-1 describe-cluster –name eks-cluster –query cluster.status

    update eks cluster
    aws eks –region us-east-1 update-kubeconfig –name eks-cluster


    To enable worker nodes to join your cluster
    curl -o aws-auth-cm.yaml
    vi aws-auth-cm.yaml

    kubectl apply -f aws-auth-cm.yaml

    kubectl get nodes –watch

    Deploy nginx image
    kubectl run –image=nginx nginx-app –port=80

    kubectl expose deployment nginx-app –port=80 –name=nginx-http –type LoadBalancer


    Previous articleScaling an AKS (Azure Kubernetes Services) cluster explained in plain English
    Next articleDocker on AWS with Amazon ECR & ECS (Part 1)


    1. Hi Thanks for the video.

      I have one question here, when we are using EKS, for example i have 3 pod should always up and running, for some reason my one of the pod went for pending state, when the pod status pending the EKS will provision the new worker node and schedule the pending pod on the new worker node itself?

    2. i dont understand when inputting create cluster with cli, he said "An error occurred (AccessDeniedException) when calling the CreateCluster operation: User: arn:aws:sts::951216862528:assumed-role/ec2-role-for-eks-cluster/i-02c9 2d5e50c8330a3 is not authorized to perform: eks:CreateCluster on resource: arn:a ws:eks:us-east-1:951216862528:cluster/eks-cluster-demo with an explicit deny

      what should i do,mr?