tutorial.mp4
This project aims to deploy a scalable two-tier application running on Flask and MySQL, designed to handle 10,000 concurrent users while adhering to best DevOps practices. By leveraging Docker, Kubernetes, and AWS services, we ensure fault tolerance, scalability, and efficient deployment.
-
Scalability: Designed to handle 10,000 concurrent users.
-
Fault Tolerance: Utilizes Kubernetes on EKS for fault tolerance.
-
Containerization: Dockerized application for portability and consistency.
-
Automated Deployment: Automated Kubernetes cluster setup using HELM.
-
Continuous Integration/Continuous Deployment (CI/CD): Implemented DockerHub repository for versioning and continuous deployment.
-
Improved Downtime: Reduced downtime by 60% with AWS Managed EKS.
-
Execute the commands one by one, this is for Ubuntu
sudo apt install
sudo apt update
sudo apt install docker.io
sudo chown $USER /var/run/docker.sock
docker ps
-
Now, execute below commands one by one
git clone https://github.com/mdazfar2/two-tier-flask-app.git
cd two-tier-flask-app
docker build . -t flaskapp
docker images
docker network create twotier
docker run -d -p 5000:5000 --network=twotier -e MYSQL_HOST=mysql -e MYSQL_USER=admin -e MYSQL_PASSWORD=admin -e MYSQL_DB=myDB --name=flaskapp flaskapp:latest
docker run -d -p 3306:3306 --network=twotier -e MYSQL_DATABASE=myDB -e MYSQL_USER=admin -e MYSQL_PASSWORD=admin -e MYSQL_ROOT_PASSWORD=admin --name=mysql mysql:5.7
-
Now use the Ip and add the port to :5000
-
Then execute the command for MYSQL-
docker exec -it 634c54ae7bbb bash
Note
Instead of 634c54ae7bbb use the container Id
of MYSQL.
mysql -u root -p
Note
After run the up command then, Put the password admin
.
show databases;
use myDB
CREATE TABLE messages (
id INT AUTO_INCREMENT PRIMARY KEY,
message TEXT
-
Show your messages in you MYSQL Database
select * from messages;
-
If you want to delete all the history from your database
DELETE FROM messages;
This is all that I deployed two tier flask app using dockerising . If you stuck during making this project, feel free to ask anything. I love to help you. You can contact me on LinkedIn, Instagram or Discord