Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions vinayapriyacc@mulearn/FinalProject/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM nginx:alpine

RUN apk add --no-cache gettext

COPY index.html /usr/share/nginx/html/index.html.template

CMD ["/bin/sh", "-c", "envsubst '$STUDENT_NAME' < /usr/share/nginx/html/index.html.template > /usr/share/nginx/html/index.html && exec nginx -g 'daemon off;'"]

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions vinayapriyacc@mulearn/FinalProject/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: scalable-webapp-deployment
spec:
replicas: 3
selector:
matchLabels:
app: scalable-webapp
template:
metadata:
labels:
app: scalable-webapp
spec:
containers:
- name: scalable-webapp
image: scalable-webapp:v2
imagePullPolicy: Never
ports:
- containerPort: 80
env:
- name: STUDENT_NAME
value: "Vinayapriya"
49 changes: 49 additions & 0 deletions vinayapriyacc@mulearn/FinalProject/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My First Scalable Web App</title>
<style>
body {
margin: 0;
font-family: Arial, sans-serif;
background: #f4f7fb;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
color: #222;
}
.card {
background: white;
padding: 2rem;
border-radius: 16px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
text-align: center;
max-width: 600px;
}
h1 {
color: #0d6efd;
margin-bottom: 1rem;
}
p {
margin: 0.5rem 0;
}
.env {
margin-top: 1rem;
font-weight: bold;
color: #198754;
}
</style>
</head>
<body>
<div class="card">
<h1>My First Scalable Web App</h1>
<p>This app is containerized with Docker and deployed on Kubernetes using KIND.</p>
<p>It is running with multiple replicas.</p>
<p class="env">Student: ${STUDENT_NAME}</p>
</div>
</body>
</html>

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions vinayapriyacc@mulearn/FinalProject/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: scalable-webapp-service
spec:
type: NodePort
selector:
app: scalable-webapp
ports:
- protocol: TCP
port: 80
targetPort: 80
nodePort: 30081