Scenario
You joined a company as a Junior DevOps Engineer.
A developer gives you a simple web application. Your task is to containerize it and deploy it to AWS EKS so customers can access it from the internet.
Final architecture:
Developer Code
β
Dockerfile
β
Docker Image
β
Amazon ECR
β
EKS Cluster
β
Node Group
β
Deployment
β
ReplicaSet
β
3 Pods
β
Service
β
Ingress
β
AWS Load Balancer Controller
β
ALB
β
Internet / Browser
PART 1 β Create the project
Create:
mkdir jumptotech-homework
cd jumptotech-homework
Your final directory should contain:
jumptotech-homework/
β
βββ index.html
βββ Dockerfile
βββ deployment.yaml
βββ service.yaml
βββ ingress.yaml
Create an index.html that displays:
JumpToTech DevOps
Docker β ECR β EKS
My Kubernetes Application is Running!
Design is up to you.
PART 2 β Docker
Create a Dockerfile.
Requirements:
- Use
nginx:alpine - Copy
index.htmlinto Nginx - Application listens on port
80
Build the image:
docker build -t jumptotech-homework:v1 .
Verify:
docker images
Run it locally:
docker run -d \
--name homework-test \
-p 8080:80 \
jumptotech-homework:v1
Check:
docker ps
Open:
http://localhost:8080
You must see your application.
PART 3 β Docker troubleshooting
Run:
docker logs homework-test
Enter the container:
docker exec -it homework-test sh
Inside:
pwd
ls
cat /usr/share/nginx/html/index.html
Exit:
exit
Then:
docker inspect homework-test
Find:
- Image
- Ports
- Network
- IP address
Stop and remove:
docker stop homework-test
docker rm homework-test
PART 4 β Create Amazon ECR repository
Create your own ECR repository.
Name:
jumptotech-homework
Verify it exists:
aws ecr describe-repositories \
--region us-east-1
Find your AWS account ID:
aws sts get-caller-identity
Your ECR URI will look like:
ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/jumptotech-homework
PART 5 β Login to ECR
Authenticate Docker:
aws ecr get-login-password --region us-east-1 | \
docker login \
--username AWS \
--password-stdin \
ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com
You should get:
Login Succeeded
PART 6 β Build for EKS
β οΈ Students with Apple Silicon Macs must pay attention to architecture.
Check your EKS node architecture later with:
kubectl get nodes \
-o custom-columns="NODE:.metadata.name,ARCH:.status.nodeInfo.architecture"
For standard AMD64 worker nodes, build:
docker buildx build \
--platform linux/amd64 \
-t ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/jumptotech-homework:v1 \
--push .
Verify the image:
docker buildx imagetools inspect \
ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/jumptotech-homework:v1
Find:
linux/amd64
PART 7 β Connect to EKS
Find your cluster:
aws eks list-clusters --region us-east-1
Connect:
aws eks update-kubeconfig \
--region us-east-1 \
--name YOUR_CLUSTER_NAME
Test:
kubectl get nodes
All worker nodes should show:
Ready
PART 8 β Understand the Node Group
Run:
aws eks list-nodegroups \
--cluster-name YOUR_CLUSTER_NAME \
--region us-east-1
Then:
kubectl get nodes -o wide
Answer in your homework:
What is a Node Group?
What is a Node?
What runs on the Node?
Does a Deployment run directly on a Node?
PART 9 β Create Deployment
Create:
deployment.yaml
Requirements:
Deployment name:
homework-deployment
Replicas:
3
Pod label:
app=homework
Container name:
homework-container
Container port:
80
Image:
your ECR image :v1
Do not copy an old Deployment blindly. Write the YAML yourself.
Apply:
kubectl apply -f deployment.yaml
PART 10 β Verify Kubernetes
Run:
kubectl get deployments
Then:
kubectl get rs
Then:
kubectl get pods
Then:
kubectl get pods -o wide
All three Pods should eventually be:
1/1 Running
PART 11 β Prove ownership
Pick one Pod:
kubectl describe pod POD_NAME
Find:
Controlled By:
It should show a ReplicaSet.
Then:
kubectl describe rs REPLICASET_NAME
Find:
Controlled By:
You should be able to prove:
Deployment
β
ReplicaSet
β
Pod
β
Container
Take a screenshot.
PART 12 β Troubleshoot your Pods
Check:
kubectl describe deployment homework-deployment
Then:
kubectl describe pod POD_NAME
Then:
kubectl logs POD_NAME
Students must know when each command is useful.
PART 13 β Create Service
Create:
service.yaml
Requirements:
Name:
homework-service
Type:
ClusterIP
Selector:
app=homework
Port:
80
TargetPort:
80
Apply:
kubectl apply -f service.yaml
Check:
kubectl get svc
Then:
kubectl describe svc homework-service
PART 14 β Prove Service found the Pods
Run:
kubectl get endpoints homework-service
You should have backend endpoints corresponding to your Pods.
Also:
kubectl get pods -o wide
Compare the Pod IP addresses.
Explain:
Service
selector app=homework
β
+------+------+------+
| | | |
β β β
Pod 1 Pod 2 Pod 3
PART 15 β Intentionally break the Service π₯
This is required.
Change:
selector:
app: homework
to something incorrect:
selector:
app: wrong
Apply:
kubectl apply -f service.yaml
Now:
kubectl get endpoints homework-service
Explain why the endpoints disappeared.
Then fix the selector and apply again.
This part must be demonstrated in your presentation.
PART 16 β Test without ALB
Before creating Ingress, prove that the application works.
Run:
kubectl port-forward \
service/homework-service \
8080:80
Keep the terminal open.
Open:
http://localhost:8080
You should see your application.
Traffic:
Browser
β
localhost:8080
β
kubectl port-forward
β
Service
β
Pod
β
Container
If port 8080 is busy:
lsof -i :8080
Use another port, for example:
kubectl port-forward \
service/homework-service \
8081:80
PART 17 β Check AWS Load Balancer Controller
Now move toward production-style internet access.
Check:
kubectl get deployment \
-n kube-system \
aws-load-balancer-controller
Check:
kubectl get pods -n kube-system
And:
kubectl get ingressclass
You are looking for the ALB controller/IngressClass.
If the controller is not installed, document that finding rather than randomly installing commands from the internet. We will review controller installation and AWS permissions together if needed.
PART 18 β Create Ingress
If AWS Load Balancer Controller is correctly installed, create:
ingress.yaml
Requirements:
Ingress name:
homework-ingress
Ingress class:
alb
Scheme:
internet-facing
Target type:
ip
Path:
/
Backend:
homework-service
Backend port:
80
Apply:
kubectl apply -f ingress.yaml
Check:
kubectl get ingress
Then:
kubectl describe ingress homework-ingress
PART 19 β Find the ALB
Watch:
kubectl get ingress -w
When successfully provisioned, the ADDRESS field should eventually show an AWS load balancer hostname.
Then test that address in your browser.
Final runtime concept:
INTERNET
|
β
DNS
|
β
AWS ALB
|
routing rules
|
β
homework-service
|
+----------+----------+
β β β
Pod 1 Pod 2 Pod 3
β β β
Container Container Container
PART 20 β Understand Ingress vs Controller
Every student must explain this.
Ingress
Rules / desired configuration
Example:
/ β frontend-service
/api β api-service
/admin β admin-service
AWS Load Balancer Controller
Watches Kubernetes resources
β
Calls AWS APIs
β
Creates/configures AWS resources
β
ALB
Listeners
Rules
Target Groups
ALB
Receives actual HTTP/HTTPS requests
β
Uses configured routing
β
Sends traffic to appropriate backend
Do not say:
User β Controller β Pod
The Controller is not forwarding every customer request.
PART 21 β Troubleshooting challenge
If the website doesn't work, students must troubleshoot in this order:
kubectl get ingress
kubectl describe ingress homework-ingress
kubectl get svc
kubectl describe svc homework-service
kubectl get endpoints homework-service
kubectl get pods -o wide
kubectl describe pod POD_NAME
kubectl logs POD_NAME
And explain the logic:
Browser
β
ALB available?
β
Ingress configured?
β
Service exists?
β
Endpoints exist?
β
Pods Ready?
β
Correct targetPort?
β
Container running?
β
Application logs
PART 22 β Scaling challenge
Start with:
kubectl get pods
Scale from 3 Pods to 5:
kubectl scale deployment \
homework-deployment \
--replicas=5
Watch:
kubectl get pods -w
Then:
kubectl get endpoints homework-service
Answer:
Did you manually tell the Service about the two new Pods?
No.
Why?
Because:
Service selector
app=homework
β
automatically matches
β
new Pods with app=homework
PART 23 β Self-healing challenge π₯
Find a Pod:
kubectl get pods
Delete one:
kubectl delete pod POD_NAME
Immediately:
kubectl get pods -w
Observe what Kubernetes does.
Explain:
Deployment wants 5
β
One Pod deleted
β
Only 4 remain
β
ReplicaSet detects mismatch
β
Creates replacement
β
Back to 5
This is desired state + reconciliation/self-healing.
PART 24 β Final cleanup
AWS resources cost money, so cleanup is part of the homework.
Delete Ingress first:
kubectl delete -f ingress.yaml
Verify the associated ALB resources are being removed before deleting the rest.
Then:
kubectl delete -f service.yaml
kubectl delete -f deployment.yaml
Check:
kubectl get ingress
kubectl get svc
kubectl get pods
Do not delete a shared class EKS cluster or Node Group unless instructed.
π€ Monday presentation
Each student gets 5 minutes.
They must show one architecture diagram:
Code
β
Dockerfile
β
Image
β
ECR
β
EKS
β
Deployment
β
ReplicaSet
β
Pods
β
Service
β
Ingress
β
ALB
β
Customer
Then answer:
- What is the difference between Image and Container?
- Why do we push the image to ECR?
- What is a Node Group?
- What is a Deployment?
- What creates/manages the Pods for a Deployment?
- How can you find which ReplicaSet owns a Pod?
- Why shouldn't customers connect directly to Pod IPs?
- How does Service find its Pods?
- What are
portandtargetPort? - What happens if the Service selector is wrong?
- What is Ingress?
- What is an Ingress Controller?
- Who configures/creates the ALB in this architecture?
- Who handles the actual HTTP request?
- What happens when a Pod dies?
- Why did some Apple Silicon users need
--platform linux/amd64? - What does
ImagePullBackOffmean? - What is the difference between
kubectl getandkubectl describe? - What does
kubectl logstell you? - How would you troubleshoot if the website stopped working?
Homework is complete only when the student can explain the architecture
The goal is not just to make the browser open.
The student should be able to look at this:
ALB β Service β Pod
and explain how the application got there from source code, where the image is stored, where the Pod runs, how Service discovers its backends, how Ingress/Controller configure external routing, and how they would troubleshoot each layer if something failed.
Top comments (0)