CI/CD Project Part 1: Provision AWS Infrastructure
Six Ubuntu VMs, one security group, ready for Kubernetes and Jenkins. Step-by-step in the AWS console.
Series
End-to-End CI/CD Pipeline Project
- 0Real Project: Deploy a Java App with Jenkins, SonarQube, Nexus, Docker & Kubernetes
- 1CI/CD Project Part 1: Provision AWS InfrastructureReading
- 2CI/CD Project Part 2: Install Kubernetes with kubeadm
- 3CI/CD Project Part 3: Jenkins + Nexus + SonarQube + Docker
- 4CI/CD Project Part 4: The Complete Jenkinsfile (11 Stages)
- 5CI/CD Project Part 5: Monitoring with Prometheus + Grafana
Part 1 — AWS Infrastructure
What we're building
Six EC2 instances, all in the same VPC and same security group so they can talk on the private network.
| # | Name | Instance type | Ports to open |
|---|---|---|---|
| 1 | k8s-master | t2.medium | 22, 6443 (API), 10250 |
| 2 | k8s-worker-1 | t2.medium | 22, 10250, 30000-32767 |
| 3 | k8s-worker-2 | t2.medium | 22, 10250, 30000-32767 |
| 4 | jenkins | t2.medium | 22, 8080 |
| 5 | nexus-sonar | t2.medium | 22, 8081 (Nexus), 9000 (SonarQube) |
| 6 | monitor | t2.medium | 22, 9090 (Prom), 3000 (Grafana) |
Step-by-step
1. Log into AWS console → EC2
Pick region ap-south-1 (Mumbai) or the closest to you.
2. Create one security group first
Security Groups → Create → name it devops-project-sg.
Inbound rules (start permissive for the lab; tighten later):
| Type | Protocol | Ports | Source |
|---|---|---|---|
| SSH | TCP | 22 | Your IP |
| Custom TCP | TCP | 6443 | Anywhere-IPv4 |
| Custom TCP | TCP | 10250 | devops-project-sg (self) |
| Custom TCP | TCP | 30000-32767 | Anywhere-IPv4 |
| Custom TCP | TCP | 8080 | Anywhere-IPv4 |
| Custom TCP | TCP | 8081 | Anywhere-IPv4 |
| Custom TCP | TCP | 9000 | Anywhere-IPv4 |
| Custom TCP | TCP | 9090 | Anywhere-IPv4 |
| Custom TCP | TCP | 3000 | Anywhere-IPv4 |
3. Launch 6 instances
Instances → Launch Instances, then for each server:
- AMI: Ubuntu Server 22.04 LTS
- Instance type: t2.medium
- Key pair: create/use one
.pem - Security group: pick
devops-project-sg - Volume: 15 GB gp3 (enough for tools + logs)
- Tags:
Name = k8s-master(etc.)
4. SSH into each
chmod 400 devops.pem
ssh -i devops.pem ubuntu@<public-ip>
sudo hostnamectl set-hostname k8s-master # do this per box
5. Enable password auth for Jenkins (optional lab shortcut)
sudo sed -i 's/^#*PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config
sudo passwd ubuntu
sudo systemctl restart ssh
Real-world note
In production this whole file becomes Terraform. For the lab, clicks are fine, but writing a main.tf that creates these 6 boxes + SG + key pair is an excellent résumé line.
Cost heads-up
6 × t2.medium ≈ ₹0.05/hour × 6 ≈ ₹9/hour for the lab. Stop the instances when you finish for the day; terminate at the end of the project. Set a billing alarm at ₹500 in CloudWatch. You've been warned.
Keep reading
You may also like
devops
Git Handbook – Quick Reference
A complete collection of Git commands and notes, covering setup, commits, branching, merging, conflicts, and advanced workflows. This handbook is designed as a simple, step‑by‑step guide for beginners and professionals to quickly learn and apply Git in real projects.
devops
Kubernetes Explained for Absolute Beginners
The clearest possible introduction to Kubernetes — what it is, why it exists, and the seven words you need to know.
devops
GitHub Actions: A Complete CI Pipeline
Lint, test, build, publish — a battle-tested workflow template.
Discussion (0)
No comments yet. Be the first to weigh in.