Forget about provisioning & dockerization headaches—enjoy effortless deployments on AWS EKS in just a few clicks!
Tags: aws, productivity, kubernetes, lowcode
Published: 2022-11-30 15:19:28

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](https://gopaddle.io) 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

- gopaddle subscription [Free trailer] - http://portal.gopaddle.io/
- AWS IAM user with the mentioned [permissions](https://gp-cloudformation-roles.s3.amazonaws.com/aws-eks-access-default.json).

## 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9orxwm3yxehvr3wl08gh.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pmyez5rhqx5xtfwajt5b.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6oabpgbrnap2ztbv6w5v.png)

1. **Access Token**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o19mxn06udiive7aym47.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0soggp2jstrezxc3y2lx.png)

3 . **Docker registry**

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n71ja0m3ctia2qtv23bj.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r25klu7oa7fc61ke5f0a.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2rw5c6fczczcijq9mmfd.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gvia1j185uqkevbcsuhg.png)

- 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/65ucgpeaj125a1bsq1bw.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6ti4rw96ri39btf3fvpl.png)

- 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

```
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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sehnvk33j86jq6wc2zjq.png)

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 
```

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ulduvgqp1g6xhw23ds80.png)

**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](https://gopaddleio.slack.com/join/shared_invite/zt-1i4v0li3n-jyTdalvVSACeNLt39xS2PA#/shared-invite/email/expanded-email-form).