scalable web application with k8s
TRANSCRIPT
Scalable Web Application With K8s
By : Pooja
PatelNisarg
PatelJimit
About Our web Application
Steganography : Concealing message in images
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
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
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
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
Technical Details
◇ Docker-compose.yml helps building and spinning up the two containers
◇ Also links the individual containers for communication
Docker Compose
Directory Structure
Our Journey
Why Kubernetes ?◇ Scalable and Reliable◇ Availability◇ Load Balancing
STEP 3 : Using K8s
MongoDB replica set
Technical Details
server-controller.yaml
server-service.yaml
Demo
Monitoring
Future Scope
◇ Microservices