Introduction: Embarking on a Voyage – Exploring Robotics Nerd’s Robot Shop

Deploying a microservices application on AWS can be a complex journey, but it can become an exciting voyage with the proper guidance. This guide will use Robotics Nerd’s Robot Shop, a microservices-based sample application, to demonstrate how to deploy and manage a microservices architecture on AWS. By the end of this guide, you’ll have a clear understanding of setting up the necessary AWS infrastructure and deploying a microservices application using Kubernetes.

Prerequisites: Setting Up IAM User, EC2 Instance, and Required Packages

Ensure you have the necessary prerequisites before diving into the deployment process. This includes setting up an IAM user, provisioning an EC2 instance, and installing the required packages.

IAM User Creation in AWS

  1. Sign in to AWS Management Console: Log in to your AWS account.
  2. Navigate to IAM: Go to the Identity and Access Management (IAM) service.
  3. Create a New User: Click on “Users” and then “Add user.”
    • Username: Provide a username, e.g., robotshop-deployer.
    • Access type: Select “Programmatic access” to create an access key.
  4. Attach Policies: Assign the necessary policies to the user.
    • AdministratorAccess: For this guide, we will use AdministratorAccess for simplicity.
  5. Review and Create: Review the settings and click “Create user.” Note down the access key ID and secret access key.

EC2 Instance Provisioning

  1. Launch an EC2 Instance: Navigate to the EC2 dashboard and click “Launch Instance.”
    • AMI: Choose an Amazon Linux 2 AMI.
    • Instance Type: Select an instance type, e.g., t2.micro.
    • Key Pair: Select or create a key pair for SSH access.
    • Network Settings: Configure the VPC and subnet.
    • Storage: Allocate storage as needed.
  2. Security Group: Configure a security group to allow SSH (port 22) access from your IP.
  3. Launch: Review the instance details and launch the instance.

Connect to Instance and Install Required Packages

  1. SSH into the Instance: Use the key pair to connect to the instance.

    ssh -i /path/to/key-pair.pem ec2-user@<EC2-Public-IP>
  1. Update and Install Packages: Update the system and install Docker and Kubernetes tools.

    sudo yum update -y

sudo yum install -y docker

sudo systemctl start docker

sudo usermod -aG docker ec2-user

sudo yum install -y kubectl

EKS Cluster Setup and Configuration

Setting Up Commands for Configuring IAM OIDC Provider

  1. Install AWS CLI: Ensure AWS CLI is installed.

    sudo yum install -y aws-cli
  1. Create an OIDC Identity Provider: Configure the IAM OIDC provider for EKS.

    eksctl utils associate-iam-oidc-provider –region <region> –cluster <cluster-name> –approve

Setting Up ALB Add-On

  1. Install the ALB Ingress Controller: Deploy the ALB Ingress Controller using Helm.

    helm repo add eks https://aws.github.io/eks-charts

helm repo update

kubectl apply -k “github.com/aws/eks-charts/stable/aws-load-balancer-controller//crds?ref=master”

helm install aws-load-balancer-controller eks/aws-load-balancer-controller \

  –set clusterName=<cluster-name> \

  –set serviceAccount.create=false \

  –set region=<region> \

  –set vpcId=<vpc-id> \

  –set serviceAccount.name=aws-load-balancer-controller

EBS CSI Plugin Setup and Configuration

  1. Install the EBS CSI Driver: Deploy the EBS CSI driver to manage EBS volumes.

    kubectl apply -k “github.com/kubernetes-sigs/aws-ebs-csi-driver/deploy/kubernetes/overlays/stable/ecr/?ref=master”

Robotics Nerd’ Robot Shop Deployment

  1. Clone the Repository: Clone the Robotics Nerd’ Robot Shop repository.

    git clone https://github.com/instana/robot-shop.git

cd robot-shop/K8s

  1. Deploy the Application: Apply the Kubernetes manifests to deploy Robotics Nerd’ Robot Shop.

    kubectl apply -f namespace.yaml

kubectl apply -f .

Conclusion: Unveiling the Depths – A Voyage through Robotics Nerd’ Robot Shop Deployment and Configuration

Deploying a microservices application on AWS using Kubernetes involves several critical steps, from setting up IAM users and EC2 instances to configuring EKS and deploying the application. By following this guide, you have embarked on a journey through the depths of AWS infrastructure and Kubernetes configuration, culminating in the successful deployment of Robotics Nerd’ Robot Shop.

References

Automatically Visualize and Monitor Applications on Amazon EKS with Instana

Microservices