Project Title:
Building and deployment of a Java Web Application using various DevOps tools and
technologies (StackPilot)
INTERNSHIP PROJECT REPORT
IBM CAREER EDUCATION
COURSE NAME:
ADROIT IBM AGILE THINKING AND DEVOPS COURSE
VIT Bhopal University
Bhopal, Madhya Pradesh – 466114
April, 2025
Submitted By:
Prerna Kumari - 22BEY10020
Priyanshi Sharma - 22BCE11009
Jayana Sawlani - 22BAC10042
Index
SI. NO. Topic Page No.
1. Proposal & Idea Submission 4-7
1.1 Introduction
1.2 Project Overview and Architecture
1.3 Tools & Technologies
2. Implementation & Execution 8-38
2.1 Infrastructure as Code with Terraform
2.2 Continuous Integration with Jenkins
2.3 Configuration Management with Ansible
2.4 Containerization and CI/CD Pipelines
2.5 Container Orchestration on AWS EKS
2.6 Continuous Deployment with Jenkins and
Ansible
2.7 Application Deployment & Testing
3. Results: 39-43
3.1 Outputs & discussion
4. CONCLUSION 44
1. Proposal & Idea Submission
1.1 Introduction
In an age where rapid innovation and cloud scalability are paramount, StackPilot delivers
a seamless, end‑to‑end deployment pipeline on AWS by integrating industry‑leading
DevOps tools and practices. The process begins with Terraform scripts and manifest files
(provided in this repository) to provision all required infrastructure—ranging from EC2
instances and VPCs to an Amazon EKS cluster—entirely through Infrastructure as Code.
Next, Jenkins (with Maven integration) compiles and tests application code before
packaging it into Docker images, while Ansible playbooks enforce consistent
configuration across both the Ansible server and Kubernetes nodes. Finally, declarative
Kubernetes manifests deploy these containers to the EKS cluster, and a Jenkins‑driven
continuous deployment workflow ensures that validated updates roll out automatically .
This modular pipeline not only automates resource provisioning and application delivery
but also guarantees environment parity, scalability, and repeatability.
By weaving together Terraform, Jenkins, Ansible, Docker, and Amazon EKS into a
unified workflow, StackPilot serves as a practical blueprint for organizations striving to
accelerate their software delivery lifecycle with reliability and efficiency.
1.2 Project Overview and Architecture
A.Project Overview:
StackPilot presents a comprehensive DevOps pipeline that automates the provisioning,
configuration, and deployment of a cloud‑native application on AWS. At its core, the project
leverages Terraform to define and spin up all necessary infrastructure
components—including EC2 instances, networking (VPCs, subnets, security groups), and an
Amazon EKS cluster—entirely as code. This approach ensures that environments are
reproducible and version‑controlled from the outset .
Once the infrastructure is live, Jenkins orchestrates the Continuous Integration phase.
Integrated with Maven, Jenkins checks out source code, compiles and unit‑tests the
application, and then builds Docker images. These images are stored locally on build servers
or pushed to a registry, ready for orchestration. Ansible then takes over configuration
management: playbooks install required software, set up users and permissions on both the
Ansible control node and all EKS worker nodes, and enforce consistent system state across
environments .
In the Continuous Deployment stage, Docker containers are deployed to the EKS cluster via
Kubernetes manifests. A Jenkins CD job triggers these Ansible‑managed deployments,
ensuring that new image versions roll out smoothly with zero‑downtime strategies if desired.
By modularizing each phase—Infrastructure as Code, CI, configuration management,
container orchestration, and CD—StackPilot delivers a repeatable, scalable blueprint for
modern cloud deployments, reducing manual effort and minimizing configuration drift.
B. Architecture:
1.4 Tools & Technologies:
● Terraform: Infrastructure as Code for provisioning AWS resources (EC2, VPC, security
groups, EKS cluster)
● eksctl: CLI tool for creating and managing EKS clusters
● AWS CLI: Command‑line interface for AWS service management, including EKS
kubeconfig updates
● Amazon EC2 (Amazon Linux 2): Virtual machines hosting Terraform, Jenkins, and
Ansible control nodes
● Amazon EKS: Managed Kubernetes control plane for container orchestration
● Jenkins: Continuous Integration and Continuous Deployment server
● Maven: Build automation tool integrated into Jenkins for compiling and packaging Java
applications
● Ansible: Configuration management for installing software (Docker, Java, Git, etc.) and
enforcing environment consistency
● Docker: Containerization platform for building and running application images
● Kubernetes: Container orchestration via Kubernetes manifests (Deployment, Service) on
the EKS worker nodes
● kubectl: Kubernetes CLI for applying manifests and managing cluster resources
● Git: Version control system for source code and infrastructure manifests
● Java (OpenJDK 11 / Amazon Corretto): Runtime environment for Jenkins and application
builds
● YUM & Amazon‑Linux‑Extras: Package managers for installing Terraform, Jenkins,
Ansible, and Docker dependencies
● IAM Roles & Policies: AWS identity and access management for EC2 instances and EKS
node permissions (e.g., AmazonEC2FullAccess, AdministratorAccess)
2. Implementation & Execution:
This section provides a detailed walkthrough of the implementation and execution phases
involved in building and deploying StackPilot, using a suite of integrated DevOps tools. Each
stage of the pipeline plays a crucial role in ensuring a streamlined, automated, and scalable
deployment workflow.
2.1 Infrastructure as Code with Terraform
The implementation begins with defining the entire cloud infrastructure using Terraform, adhering
to the Infrastructure as Code (IaC) approach. Terraform scripts are written in HCL (HashiCorp
Configuration Language) and stored in a version-controlled repository to ensure reproducibility
and traceability.
Key infrastructure components provisioned:
● Virtual Private Cloud (VPC) with subnets, route tables, and internet gateways
● Security Groups to manage access controls
● EC2 Instances for Jenkins and Ansible
● Amazon EKS Cluster for container orchestration
● IAM Roles and Policies for secure access management
Terraform commands such as terraform init, terraform plan, and terraform apply are used
sequentially to initialize, preview, and provision infrastructure resources
2.1.1 Start a Terraform Server on AWS
2.1.2 Install and Configure Terraform
2.2 Continuous Integration with Jenkins
Jenkins acts as the automation hub for the CI process, enabling the automated building, testing,
and packaging of the Java application. Integrated with Maven, Jenkins ensures that every code
commit is continuously validated, reducing the chances of integration issues.
2.2.1 Start a Jenkins Server on AWS
An Amazon EC2 instance is launched (using Terraform or manually) to host the Jenkins server.
The instance is configured with:
● A security group allowing access on port 8080
● Sufficient storage and compute for build tasks.
Steps:
● Connect via SSH and install Java (required by Jenkins)
● Add the Jenkins repo and install Jenkins using:
sudo yum install jenkins
sudo systemctl start jenkins
sudo systemctl enable jenkin
● Retrieve the initial admin password from
/var/lib/jenkins/secrets/initialAdminPassword to unlock the UI
2.2.2 Install and Configure Jenkins
Once Jenkins is up, essential plugins are installed via the plugin manager:
● Git Plugin
● Maven Integration Plugin
● Docker Pipeline
● Ansible Plugin (for later integration)
Global tool configurations are set for:
● Git path
● Maven installation (if not already installed on the server)
● Java version
2.2.3 Configure Maven Integration
Maven is used to build and manage the Java application. After installing Maven on the server:
● Configure its location in Manage Jenkins → Global Tool Configuration
● Create environment variables (M2_HOME, JAVA_HOME) if needed
● Ensure Maven is accessible system-wide or define a specific installation for Jenkins
2.2.4 Create a Test Job
A freestyle or pipeline job is created to:
● Pull the Java source code from a version control system like GitHub
● Run mvn clean install to compile and test the application
● Archive the resulting JAR/WAR files
● Optionally trigger downstream jobs for Docker packaging
This validates the build process and sets the stage for containerization and deployment.
2.3 Configuration Management with Ansible
Ansible ensures consistency across all environments by automating server setup and configuration
tasks.
2.3.1 Start and Configure Ansible Server
An EC2 instance is set up to act as the Ansible control node. Essential steps include:
● Install Ansible with sudo yum install ansible (or via pip if needed)
● Set up the inventory file listing target nodes (e.g., Jenkins server, EKS worker nodes)
● Test connectivity using ansible all -m ping
● Write basic playbooks for provisioning tasks like installing Docker or Kubernetes tools
2.3.2 Integrate Ansible with Jenkins
To execute Ansible playbooks from Jenkins:
● Install the Ansible plugin in Jenkins or use shell steps in pipeline jobs
● Configure Jenkins to run playbooks post-build, for example:
ansible-playbook -i inventory playbook.yml
● This integration helps Jenkins handle both CI and deployment tasks via Ansible
automation
2.4 Containerization and CI/CD Pipelines
This stage prepares the application for container-based deployment by building Docker images
and preparing Jenkins jobs for CI/CD automation.
2.4.1 Install Docker on Ansible Server
Docker is installed on the Ansible control node and other EC2/Kubernetes nodes where
needed:
● Install using sudo yum install docker
● Start and enable Docker with systemctl
● Add the current user to the docker group to avoid sudo
2.4.2 Create Dockerfile and Ansible Playbook for Build
A Dockerfile is written to containerize the Java application:
FROM openjdk:11
COPY target/MyApp.jar /app.jar
ENTRYPOINT ["java", "-jar", "/app.jar"]
Ansible playbooks automate:
● Docker installation
● Dockerfile copying
● Image building and tagging
● Pushing to Docker Hub or AWS ECR (via docker push)
2.4.3 Create the CI Job in Jenkins
A Jenkins pipeline or freestyle job is created to:
● Build the Docker image using the Dockerfile
● Tag the image with the build number or Git commit hash
● Push the image to a container registry
● Trigger a deployment job if the image build is successful
2.5 Container Orchestration on AWS EKS
Amazon Elastic Kubernetes Service (EKS) is used to manage and scale containerized workloads.
2.6 Continuous Deployment with Jenkins and Ansible
2.6.1 Create CD Job on Jenkins:
❖ Open Jenkins Dashboard
● Access Jenkins via browser:
❖ Create New Item
● Click on “New Item”
● Enter a name
● Select Freestyle project or Pipeline (recommended for flexibility)
● Click OK
❖ Configure the Job
● In General, optionally check “Discard old builds” to manage logs
● In Source Code Management, choose Git and enter your repo URL (if
manifests/playbooks are versioned)
❖ Add Build Step
● Click Add build step → Execute shell
❖ Add the Ansible playbook execution command:
bash
CopyEdit
● Ensure Jenkins has SSH access and Ansible installed/configured
● If needed, run ssh-copy-id from Jenkins to EKS server beforehand
❖ Post-build Actions (Optional)
● Add notifications or other post-deployment scripts/logs
● Example: Slack, Email, or kubectl get pods as validation
❖ Save the Job
2.6.2 Integrate CI and CD Pipelines:
Option 1: Trigger CD from CI Job
● Go to your CI job (e.g., MyApp-CI-Job)
● Under Post-build Actions, select:
○ Build other projects → Add the name of the CD job (e.g., MyApp-CD-Job)
○ Check Trigger only if build is stable
Option 2: Pipeline Script (Recommended)
If you're using a pipeline project (Jenkinsfile), define both CI and CD stages:
3. Results:
A.Output:
The successful execution of StackPilot results in the deployment of a fully functional,
cloud-native application hosted on a Kubernetes cluster managed by Amazon EKS. All
supporting infrastructure components—including EC2 instances, VPC, IAM roles, and security
groups—are provisioned automatically using Terraform scripts. Jenkins, integrated with Maven,
builds and tests the application, and Docker packages it into container images. Ansible playbooks
install necessary dependencies, configure servers, and automate the deployment process. These
images are then deployed onto the EKS cluster using Kubernetes manifests.
Once the CI/CD pipeline is configured, a code push or manual trigger in Jenkins initiates a
seamless build, configuration, and deployment process. The application is launched in containers
managed by Kubernetes, accessible via the configured load balancer or service endpoint.
Validation through kubectl get nodes, kubectl get pods, and Jenkins console outputs confirms that
pods are running, deployments are healthy, and the pipeline has executed without errors.
B.Output Discussion:
The outcome of this project confirms that DevOps automation significantly reduces manual
intervention, ensures repeatability, and improves deployment speed and reliability. Terraform
successfully provisioned cloud infrastructure in a structured and idempotent manner, while
Jenkins' pipeline automation ensured rapid feedback and traceability during code changes. The
integration with Ansible and Docker enabled environment consistency and faster container builds.
Finally, the orchestration with Kubernetes on EKS proved effective in scaling and managing
application workloads efficiently.
This automated pipeline model not only saves time but also minimizes configuration drift, making
it ideal for production-ready deployments. The ability to reproduce infrastructure and application
states across environments highlights the robustness and scalability of this DevOps approach.
Individual Contributions
Team Member 1: Priyanshi Sharma
1. Proposal & Idea Submission
● 1.1 Introduction
○ Researched current DevOps best practices and drafted the project goals and scope.
○ Wrote the motivation section, outlining why IaC, CI/CD, and container
orchestration matter.
● 1.2 Project Overview & Architecture
○ Designed the end‑to‑end architecture diagram (Terraform → AWS → Ansible →
Kubernetes).
○ Defined the high‑level component interactions and documented them in the
proposal.
● 1.3 Tools & Technologies
○ Evaluated and selected Terraform, Jenkins, Ansible, Docker, and EKS based on
project requirements.
○ Prepared the comparative table of alternative tools (e.g. Chef vs. Ansible).
2. Implementation & Execution
● 2.1 Infrastructure as Code with Terraform
○ Authored Terraform modules for VPC, subnets, IAM roles, and EKS cluster.
○ Published a reusable Terraform registry module and performed peer reviews.
● 2.2 Continuous Integration with Jenkins
○ Installed and secured the Jenkins master node on EC2.
○ Created scripted pipelines (Jenkinsfile) to fetch code from GitHub and invoke
Maven builds.
● 2.3 Configuration Management with Ansible
○ Wrote dynamic Ansible roles to configure worker node security groups and install
Docker.
○ Integrated Ansible Vault to manage sensitive variables (e.g. AWS credentials).
3. Results: Outputs & Discussion
● Collected Terraform plan/apply logs and extracted key resource counts and timings.
● Analyzed and visualized infrastructure provisioning performance (average apply time:
4m32s).
● Co‑authored the discussion on how IaC improved reproducibility and reduced manual
errors.
4. Conclusion
● Drafted the summary of infrastructure outcomes and lessons learned from the Terraform
rollout.
● Proposed next steps for further modularizing Terraform code and introducing remote
backends.
Team Member 2: Prerna Kumari
1. Proposal & Idea Submission
● 1.1 Introduction
○ Contributed to the literature review on CI/CD pipelines and container orchestration
trends.
● 1.2 Project Overview & Architecture
○ Defined the detailed sequence flow (Git→Jenkins→Docker→K8s) and
failure‑handling strategies.
● 1.3 Tools & Technologies
○ Benchmarked Jenkins plugins (Git, Maven, Kubernetes) and selected versions for
stability.
2. Implementation & Execution
● 2.4 Containerization and CI/CD Pipelines
○ Authored Dockerfiles for the sample Java application, optimized image layers for
speed.
○ Extended the Jenkins pipeline to build, test, and push Docker images to ECR.
● 2.5 Container Orchestration on AWS EKS
○ Configured kubectl and aws-iam-authenticator, deployed Helm charts
for core services.
○ Implemented Horizontal Pod Autoscaler (HPA) and tested scaling behavior under
load.
● 2.6 Continuous Deployment with Jenkins & Ansible
○ Integrated a Jenkins post‑build stage that triggers an Ansible playbook to roll out
updated images.
○ Developed a blue‑green deployment strategy using Ansible to switch Kubernetes
services.
3. Results: Outputs & Discussion
● Gathered Docker build times and image size statistics; compared multi‑stage vs.
single‑stage builds.
● Collected Kubernetes deployment rollout times and HPA scaling logs.
● Wrote the discussion on pipeline stability, rollback mechanisms, and deployment success
rates.
4. Conclusion
● Summarized CI/CD and orchestration results, highlighting achieved deployment
frequency and downtime reduction.
● Suggested improvements: canary releases, advanced monitoring, and integration with
service mesh.
Team Member 3: Jayana Sawlani
1. Proposal & Idea Submission
● 1.1 Introduction
○ Drafted the user‑story scenarios and acceptance criteria for end‑to‑end delivery.
● 1.2 Project Overview & Architecture
○ Mapped out security considerations (IAM policies, network ACLs) and
backup/recovery flow.
● 1.3 Tools & Technologies
○ Documented the AWS EKS service limits and cost considerations.
2. Implementation & Execution
● 2.7 Application Deployment & Testing
○ Created automated test suites (JUnit) and integrated them into the Jenkins pipeline.
○ Developed Kubernetes readiness and liveness probes to ensure application
health.
● Cross‑cutting Contributions
○ Assisted Alice with Ansible playbook testing in staging and Brian with Helm chart
templating.
○ Managed Git branching strategy and pull‑request reviews to enforce coding
standards.
3. Results: Outputs & Discussion
● Compiled application test pass/fail rates and end‑to‑end pipeline success statistics.
● Measured pod startup times and service response latencies under simulated load.
● Wrote the section on QA automation effectiveness and reliability improvements.
4. Conclusion
● Contributed the final closing remarks on overall project success, team collaboration, and
skill growth.
● Outlined recommended next steps in performance tuning, cost optimization, and DR
planning.
Conclusion
The successful implementation of MyProjectApp has demonstrated the power and effectiveness
of integrating modern DevOps tools to automate the entire software delivery lifecycle. From
infrastructure provisioning using Terraform to seamless deployment on AWS EKS via Jenkins
and Ansible, each component in the pipeline contributed to building a robust, scalable, and
repeatable workflow.
This project has not only deepened my understanding of core DevOps practices such as
Infrastructure as Code (IaC), Continuous Integration (CI), Configuration Management, and
Continuous Deployment (CD), but also provided valuable hands-on experience with tools like
Terraform, Jenkins, Ansible, Docker, and Kubernetes. By automating the provisioning, build,
deployment, and release processes, the project eliminated manual interventions, reduced
configuration drift, and ensured consistent environments across development and production.
Overall, this internship project stands as a practical blueprint for deploying Java-based
cloud-native applications using a full DevOps stack. It has equipped me with the skills and
knowledge necessary to contribute effectively in real-world DevOps environments and lays a
solid foundation for future advancements in cloud automation and deployment strategies.