DEV Community

Cover image for Forget about provisioning & dockerization headaches—enjoy effortless deployments on AWS EKS in just a few clicks!
Gayathri R
Gayathri R

Posted on

Forget about provisioning & dockerization headaches—enjoy effortless deployments on AWS EKS in just a few clicks!

Today, Amazon Elastic Kubernetes Service (EKS) is one of the widely used cloud providers for container-based applications. But setting up an AWS EKS cluster can be quite a challenge - from creating VPCs to security groups, ensuring auto scaling rules are in place on worker nodes and more. Once clusters have been set up, deploying applications requires specialized knowledge from various teams who need to invest time learning how to architect microservices before they can even begin working within containers!

As developers prepare to containerize their services, they will need to gain a comprehensive understanding of Docker, Kubernetes and systems configurations before transitioning their applications onto Amazon EKS. The complexity doesn't stop here. Once the applications are deployed to EKS clusters, developers then have to worry about integrating end-to-end DevOps automation including CI/CD pipelines and continuous monitoring capabilities.

Introducing gopaddle

gopaddle is a low-code Kubernetes platform that helps the developers, DevOps engineers and SREs to provision production-ready EKS clusters, build and deploy microservices on EKS without having to worry about complex configurations.

gopaddle offers quick start wizards to,

  • Register end-user's AWS Cloud Accounts using refined set of IAM rules.
  • Provision EKS cluster on end-users AWS Accounts - with sophisticated configurations like Self-managed nodepools, ALBs, Domain Manager integration etc.
  • Dockerize & Deploy microservices from code. gopaddle auto-generates the Dockerfiles and Kubernetes YAML files.
  • Generate Jenkins, GitHub Actions pipeline code.

In this blog, let us take a look at the process of creating an EKS cluster, Dockerizing and Deploying to EKS cluster using the quickstart wizard.

Prerequisite

Create an AWS EKS cluster

Creating an AWS EKS cluster through gopaddle is a 2 step process.

For that you have to login to your gopaddle account. You will find the quickstart wizards to create and deploy applications. Click on 'Onboard Cloud & Clusters' option.

Image description

In the quickstart wizard, provide the AWS account ID & select the region which you want to provision your EKS cluster.

Note: If you already installed AWS CLI on your machine then you can skip the AWS CLI installation step, which is step-1 in the Prerequisite section.

Image description

Then execute the shell script which is provided in the code mirror on your terminal. This will create an IAM user & provision an AWS EKS cluster.

Deploy an Application on the AWS EKS cluster

For the purpose of this blog, I have taken an Open-Source Java project from public GitHub repository & forked it to my GitHub repo.

Here is the sample project I used for the onboarding process - https://github.com/Gayathri-Bluemeric/spring-boot-hello-world.git.

Follow the below steps for deploying your application on AWS EKS cluster:-

Go to your gopaddle account's dashboard & click on the 'Dockerize & Deploy' Quick Start option.

Image description

  1. Access Token

Image description

By default, it automatically picks your gopaddle account's default API token. You can also choose to use a different access token, especially when you have a distributed team with restricted permissions. Click on the 'Next' button.

2 . Cluster

Select the EKS cluster to dockerize the application and deploy. This cluster will be used to build the source code, generate the dockerfile and build the docker image.

Image description

3 . Docker registry

Docker registry to be used for pushing and pulling the Docker image.

Image description

For registering an AWS ECR registry, you need to provide the name & region where you would like to push the docker images and click on the 'Register Docker Registry' button.

4 . Allocation Policy

The CPU & Memory capacity to be used for building & deploying your source code project.

Image description

For creating an allocation policy, provide the name & build capacity required for building & deploying your source code project. Typically a Java Springboot application would require 800 millicore CPU / 1 G Memory request & limit.

5 . Source Code

The source code account where the microservice project exists. If your project is in a public repository then you don’t need to register the source code account at the moment. However, the continuous build (CI) option is not supported for a public repository.

Image description

For registering an GitHub account, generate the GitHub Personal Access Token and provide it on the 'Github Authentication Token' text box & click on the register button.

6 . Repository

Specifies the source code repository details like:

Image description

  • Clone URL - Source Code repository URL.
  • Branch - Branch name your source code project.
  • Project Type - Type of the project like NodeJs, Java, Python, etc.
  • Base Image - This base image will be used to launch a container inside which the project scripts are run and artifacts are prepared. The base image will also be used to prepare the project-specific docker image to be deployed in Kubernetes.
  • Build on Commit - When enabled, it creates a new Docker image as and when a new commit is detected in the source control repository. This capability is available only for a private source control repository.
  • Vulnerability Scan - When enabled, it scans for vulnerabilities in the docker image created during the build process.
  • Override Environment Variables - When enabled, it overrides any conflicting environment variables found in the base image and the user provided environment variables.

7 . Environment Variables

It is an optional step. If an Environment Variable (Env) is required to build or start (run) the application, then add the Env here.

Image description

For this example project I don't have such kind of ENVs, so I'm skipping this step.

8 . Scripts

Scripts that are required for building & deploying the project.

Image description

  • buildScript - How to build your source code project.
  • startScript - How to run/start your microservice project.
  • healthCheck - This script is used for validating the service's like which is alive or not. You can use the project endpoint also as a healthcheck URL.
  • stopScript - This script is used to cleaning up the processes after completing onboarding process.

Click on the 'Download the Scripts' button. It will download the Script files as a tar file in to your desktop. Untar the file and provide the extracted location in the quickstart wizard.

$ cd Downloads 
$ tar -xvf scripts.tar 

$ cd scripts
$ ls
buildScript.sh  healthCheck.sh  startScript.sh  stopScript.sh

$ pwd
/Users/gayathrir/Downloads/scripts

Enter fullscreen mode Exit fullscreen mode

For instance the extracted folder will look like -/Users/gayathrir/Downloads/scripts

9 . Dockerize & Launch

This is the final step of the Quick Start Wizard. The Quick start wizard generates a Docker command. You can copy & execute the command on your desktop.

Image description

The docker command does the scaffolding process and automatically builds the application, pushes the docker image to the AWS ECR registry, enables CI, scans for vulnerability and deploys the application to the selected AWS EKS cluster.

Container 'spring-boot-hello-world' created successfully
Repository 'spring-boot-hello-world' created successfully
Distribution 'spring-boot-hello-world' created successfully
Container build triggered ...
Build in 'Creating' State [\]
Build created successfully
Expose port 8080 externally (Y/N)? y
Service 'spring-boot-hello-world' created successfully
Deployment Template 'spring-boot-hello-world' created successfully
Application ports mapped to Cluster node ports: [ 8080->32058 ]

Application deployment initiated ...
Launching Application [-]
Application 'spring-boot-hello-world' launched successfully

Access URL: http://18.141.182.44:32058
Use this command to purge the resources: gpctl init --purge 
Enter fullscreen mode Exit fullscreen mode

At the end of this process, the application is deployed on EKS and you will find the application access endpoint from the output.

Here, in this example, 'http://18.141.182.44:32058' is the access URL. You can access this application via browser.

Image description

Note: You have to open the firewall port (alternative target port number) on AWS EC2 instance security group's inbound rule.

Try out gopaddle for free for 15 days. Subscribe using https://portal.gopaddle.io/signUp

For more information regarding gopaddle, you can checkout https://gopaddle.io or reach us on slack.

Top comments (0)