<< PREVIOUS      NEXT >>

 

INSTALLATION

  1. Log in to the client machine created, using valid credentials

  2. Execute the commands below to install kubectl, awscli and helm

    1. apt update

       

       

    2. kubectl Installation:

      1. sudo apt-get update && sudo apt-get install -y apt-transport-https gnupg2 curl

         

         

         

      2. curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add –-

         

         

         

      3. echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list

         

         

         

      4. sudo apt-get update

         

         

      5. sudo apt-get install -y kubectl

         

         

    3. awscli Installation:

      1. sudo apt-get install awscli -y

         

         

    4. docker Installation:

      1. apt update

         

         

      2. apt install docker.io -y

         

         

      3. docker -v

         

         

  3. Procure Access Key and Secret Access Key

    1. On the AWS console, navigate to My Security Credentials

      Picture 10

    2. Click Create access key

      Picture 16

    3. Log in to the client machine and configure aws access key and secret access key using the commands below:

      1. aws configure

         

         

        Picture 1073741832

  4. On the AWS console, create EKS cluster

    1. Create an IAM role for EKS control plane

    2. Navigate to IAM > Create role. Select the required service

      Picture 12

    3. Navigate to AWS Service > EKS

      Picture 18

    4. Navigate to EKS Cluster > Permissions

      Picture 19

    5. Click AmazonEKSClusterPolicy > Tags

      Picture 20

    6. On the Review page, provide a role name. Click Create role

      Picture 22

  5. Create a new role for worker node group

    1. Navigate to IAM > Create role. Select the required service

      Picture 13

    2. Navigate to the required AWS Service > EKS. Click Permissions

      Picture 23

    3. Attach the policies - AmazonEKSWorkerNodePolicy, AmazonEKS_CNI_Policy and AmazonEC2ContainerRegistryReadOnly.

      Picture 24

    4. Click on Tag. On the Review page, provide a Role name. Click Create role

      Picture 26

    5. Click Cluster > Create Cluster

    6. Provide the Name, Kubernetes Version and Cluster Service role. Click Next

      Picture 27

    7. Select VPC, Subnets, NSG and Public Access. Execute the remaining steps to create the Cluster, with the default values

      Picture 28

    8. Once the EKS cluster becomes Active, click on cluster name

      Picture 29

    9. Click on Configuration tab. Click Compute > Add node group

      Picture 30

    10. Provide Name and IAM Role. Click Next

      Picture 1073741984

    11. Select the required instance type. Click Create

      image26

    12. Select the required Subnets and SSH keypairs. Create the Node group

  6. Once the Node Group is created, log in to the client machine

  7. Execute the commands below:

    1. Fetch the kubeconfig file from the Control plane using the commands below:

      1. aws eks --region us-east-1 update-kubeconfig --name gitlab

         

         

      2. kubectl get nodes

         

         

      3. The above command lists two machines in Ready state

  8. Install either Helm 2 OR Helm 3

  9. Helm 2 Installation:

    1.  

       

       

    2. tar -zxvf helm-v2.16.12-linux-amd64.tar.gz

       

       

    3. cd linux-amd64/

       

       

    4. mv helm /usr/local/bin

       

       

    5. helm init --stable-repo-url https://charts.helm.sh/stable 

       

       

    6. Create Tiller Pod:

      helm init

       

       

    7. helm version 

       

       

    8. Create Service Account and assign permission to the Tiller pod, so that it deploys workload on Kubernetes. Execute the commands below:

      1. kubectl create sa tiller –namespace kube-system

         

         

      2. kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller

         

         

         

      3. kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'

         

         

         

      4. Verification:

        kubectl get all --all-namespaces | grep tiller

         

         

  10. Helm 3 Installation: Tiller Pod is not required for Helm 3

    1.  

       

    2. tar -zxvf helm-v3.5.2-linux-amd64.tar.gz

       

       

    3. cd linux-amd64/

       

       

    4. mv helm /usr/local/bin

       

       

    5. helm version

       

       

 

.

 

<< PREVIOUS      NEXT >>