Skip to content

Deploy the EKS Cluster using terraform then deploy a Spring Boot application in the EKS Cluster

Notifications You must be signed in to change notification settings

santoshcisco/eks-terraform-springboot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

eks-terraform-springboot

Deploy the EKS Cluster using terraform then deploy a Spring Boot application in the EKS Cluster

image

image

We will do in a simple way:

 At first we are going to deploy EKS Cluster with Terraform

 Secondly we are going to deploy the Spring Boot Application on the EKS Cluster.

let's get our hands dirty

 Clone the Github repo

 Go to src folder then add your S3 bucket name, Dynamodb table name and region in the backend.tf file for remote terraform statefile.

 Add your AWS account user access key and secret access key in the terraform.tfvars file. Other things are optional.

 S3 bucket and DynamoDB table both should be in same Region.

Make sure below things:

 Access and Secret keys Add in the .bashrc file

 AWS Profile is configured on your linux machine or we can use the default account also.

We can see the S3 bucket and DynamoDB table in the below images

image

image

Run the below command:

 $ terraform init

image

 $ terraform plan

image

 $ terraform apply

After deploying EKS cluster using terraform, the output will be like below.

image

We can see the terraform state file in the below image

image

We can see the EKS Cluster deployed successfully in the below image

image

Now configure the kubeconfig on your machine for access the EKS Cluster, following the below command

$ aws eks --region us-west-2 update-kubeconfig --name AscendionWorkshop-cluster

image

$ kubectl get nodes –o wide

$ kubectl get pods

Switch to eks directory then deploy the SprintBoot application by using the below commands

$ kubectl apply –f deployment.yaml

Check the deployment is successful or not

$ kubectl get deployment –l app=springboot

Then deploy the Service

$ kubectl apply –f service.yaml

$ kubectl get svc

Now we can see the SpringBoot application deployment successfully

image

Now access the SpringBoot app by entering the external address of the springboot LoadBalancer in any browser from the Outside

image

About

Deploy the EKS Cluster using terraform then deploy a Spring Boot application in the EKS Cluster

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages