scalable web application with k8s

13
Scalable Web Application With K8s By : Pooja Patel Nisarg Patel Jimit

Upload: others

Post on 11-Dec-2021

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Scalable Web Application With K8s

Scalable Web Application With K8s

By : Pooja

PatelNisarg

PatelJimit

Page 2: Scalable Web Application With K8s

About Our web Application

Steganography : Concealing message in images

Page 3: Scalable Web Application With K8s

Architecture

Front End◇ Developed

single pageweb-app using ReactJS

◇ Hosted on simplepython http server

◇ Allow to select images and message to be hidden using web services running on node server

Front End Back End Database

Back End◇ Exposes REST based

HTTP web services(used express.js)

◇ Business logic written to hide and unhide the message from image

Database◇ MongoDB◇ Stores the images

with hidden message

Page 4: Scalable Web Application With K8s

Our Journey

◇ Installed MongoDB locally◇ Connecting web application to database◇ All on same machine

Cons ◇ Not scalable and reliable◇ No fault tolerance◇ Manual efforts for deployment◇ Hardware expansion costs◇ Application downtime due to maintenance

and upgrade

STEP 1 : Running Web Application Locally

Page 5: Scalable Web Application With K8s

Our Journey

◇ Pulled MongoDB container image◇ Created separate container images for front end and back

end◇ Created a single container image composed of MongoDB,

Front end and Back end using Docker Compose◇ Still on same machine

STEP 2 : Docker comes to rescue ; Docker Compose is on top

Pros◇ Rapid and simple

Deployment ◇ Easy management◇ Light weight◇ Resource isolation

Cons◇ Not scalable and

reliable◇ Low fault tolerance

Page 6: Scalable Web Application With K8s

Technical Details◇ Dockerfile defines what goes on in the

environment inside your container◇ Building the container image containing

the server side application code◇ Install the necessary dependencies which

our application is using◇ Specifies port the services will be

exposed on◇ Finally the command to start the server

Server Docker File

Client Docker File

Page 7: Scalable Web Application With K8s

Technical Details

◇ Docker-compose.yml helps building and spinning up the two containers

◇ Also links the individual containers for communication

Docker Compose

Directory Structure

Page 9: Scalable Web Application With K8s

Our Journey

Why Kubernetes ?◇ Scalable and Reliable◇ Availability◇ Load Balancing

STEP 3 : Using K8s

Page 11: Scalable Web Application With K8s

Technical Details

server-controller.yaml

server-service.yaml

Page 13: Scalable Web Application With K8s

Future Scope

◇ Microservices