Overview
In this workshop, we will walk through deploying a sample retail store application on Amazon EKS (Elastic Kubernetes Service) using a combination of CloudFormation and Terraform. This guide is divided into logical stages, from setting up foundational infrastructure to running your app on Spot and Graviton instances.
Step 1: Set Up AWS Infrastructure with CloudFormation
We’ll start by using AWS CloudFormation to provision the foundational network infrastructure (VPC, subnets, Internet Gateway, etc.) that EKS requires.
What to do:
Create a CloudFormation stack using a predefined template (YAML/JSON)
Include resources:
VPC
Public and Private Subnets
NAT Gateways
Route Tables
Launching the CloudFormation stack using a predefined template to set up a code-server IDE for the EKS workshop.
Reviewing permissions and acknowledging IAM capabilities before creating the eks-workshop-ide CloudFormation stack.
CloudFormation stack eks-workshop-ide created successfully with status CREATE_COMPLETE.
The CloudFormation stack will take roughly 5 minutes to deploy, and once completed you can retrieve information required to continue from the Outputs tab:
The IdeUrl output contains the URL to enter in your browser to access the IDE. The IdePasswordSecret contains a link to an AWS Secrets Manger secret that contains a generated password for the IDE.
To retrieve the password open that URL and click the Retrieve button, the password will then be available for you to copy::
Open the IDE URL provided and you will be prompted for the password:
After submitting your password you will be presented with the initial VSCode screen
Step 2: Prepare Terraform Configuration
With the CloudFormation networking layer in place, it’s time to define the rest of our infrastructure using Terraform. This is where we set up the EKS cluster, node groups, and other supporting components.
For the given configuration, Terraform will create the workshop environment with the following:
Resources created by Terraform:
- A VPC across three Availability Zones
- An Amazon EKS Cluster
- An IAM OIDC Provider for enabling IAM roles for service accounts
- A Managed Node Group named default for general workloads
- Configuration of the Amazon VPC CNI plugin to use prefix delegation (for improved IP management and scaling)
Terraform initial setup, including downloading necessary Terraform configuration files for the EKS workshop.
Terraform successfully deploys the EKS cluster
EKS cluster Up & running in AWS console
Node Group config within EKS cluster
Step 3: Set Up/Prepare the EKS Cluster environment
Initializing the EKS workshop environment
Verify the EKS cluster nodes, namespaces using kubectl command
Step 4: Deploy the Sample Retail Store App
In this workshop, we'll deploy the sample retail application efficiently using the power of Kustomize. The following kustomization file shows how you can reference other kustomizations and deploy multiple components together:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- rabbitmq
- catalog
- carts
- checkout
- assets
- orders
- ui
- other
Top comments (0)