A Spring Boot blogging application with user registration, login and posts, delivered through Jenkins build pipelines, a Docker image, Terraform for an Amazon EKS cluster, and Kubernetes manifests.
- Building and testing a Spring Boot application in a pipeline, on a labelled agent
- Provisioning an EKS cluster with Terraform and deploying to it with Kubernetes manifests
- Pulling from a private registry inside a cluster using an image pull secret
- Spring Boot web app with Thymeleaf pages: home feed, new post, login and registration
- Spring Security with a custom
UserDetailsService - Spring Data JPA on an in-memory H2 database, with the H2 console at
/h2-console. Data resets whenever the app restarts.
| Path | Purpose |
|---|---|
Jenkinsfile |
Compile → Test → Package with Maven 3 and JDK 17, on any agent |
Jenkinsfile1 |
The same pipeline, pinned to the slave-1 agent |
Dockerfile |
eclipse-temurin:17-jdk-alpine image that runs the packaged JAR on port 8080 |
EKS_Terraform/ |
VPC with two public subnets in ap-south-1, internet gateway, routing, security groups and the EKS cluster |
deployment-service.yml |
Deployment (2 replicas pulling a private Docker Hub image through the regcred secret) and a LoadBalancer Service, port 80 → 8080 |
flowchart LR
GH["GitHub"] --> J["Jenkins<br/>compile → test → package"]
J --> JAR["Application JAR"]
JAR --> IMG["docker build"]
IMG --> DH["Docker Hub<br/>private repository"]
TF["Terraform<br/>EKS_Terraform/"] --> EKS["Amazon EKS<br/>ap-south-1"]
DH --> DEP["Deployment: 2 replicas"]
DEP --> EKS
EKS --> LB["LoadBalancer Service<br/>port 80"]
./mvnw spring-boot:runOpen http://localhost:8080.
./mvnw clean package
docker build -t <dockerhub-user>/bloggingapp:latest .
docker push <dockerhub-user>/bloggingapp:latestcd EKS_Terraform
terraform init
terraform apply
aws eks update-kubeconfig --region ap-south-1 --name <cluster-name> # cluster name: see output.tf
kubectl create secret docker-registry regcred \
--docker-username=<dockerhub-user> --docker-password=<access-token>
kubectl apply -f ../deployment-service.yml
kubectl get svc bloggingapp-ssvc # EXTERNAL-IP is the load balancer addressChange the image in deployment-service.yml to your own before applying.
Based on jaiswaladi246/FullStack-Blogging-App by Aditya Jaiswal (DevOps Shack).
Maintained by Rajan Kumar · LinkedIn