Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
18 views20 pages

Deployment

Uploaded by

manikandanacecse
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views20 pages

Deployment

Uploaded by

manikandanacecse
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

EP 2 DevOps:- 2 Tier Application Deployment

Maninder Singh

2-Tier Application Deployment Diagram (Architecture)

Dear Learners in today topic we will deploy a 2 Tier Application Deployment with the Help of Various DevOps Tools.

Pre-requisites:-

1 Create an Ec2 Account.

2 Need a Docker file for the Flask App

Create an Ec2 instance:-

1 Login your aws account with username and Password.


2 Click on the Launch instance option on right side.

Click on the Launch instance option on right side.

3 Now give the instance name.


Now give the instance name Diagram.

4 Select the Image Ubuntu 20 and Create a New pair for your Ec2 instance.

Select the Image Ubuntu 20 and Create a New pair for your Ec2 instance Diagram.

5 Now click the Launch instance Button for Instance Creation.


Now click the Launch instance Button for Instance Creation Diagram

6 Now click on the Connect Button when your instance are in the Running Condition.
Now click on the Connect Button when your instance are in the Running Condition Diagram

7 SSH (Access your Ec2 instance with the help SSH Command)
SSH (Access your Ec2 instance with the help SSH Command) Diagram

8 Open the Terminal with the help CTRL+ALT+T, give permissions and ssh the instance.
Now click on the Connect Button when your instance are in the Running Condition Diagram.

9 Run the following command for the Package update and Docker Installation.
Run the following command for the Package update and Docker Installation Diagram

10 Create a Directory install the git

sudo apt-get update -y ; sudo apt install docker.io -y Diagram.

11 Clone the Repository form the git hub, copy the ssh and paste into the terminal here is the command.
Clone the Repository form the git hub, copy the ssh and paste into the terminal here is the command Diagram.

12 Write a Docker for the Python installation and Mysql Clinent.

13 After Written the Docker file Now build it with the following commands it includes in 1/8 Steps which i have Mentioned int the Screen shot.
After Written the Docker file Now build it with the following commands it includes in 1/8 Steps which i have Mentioned int the Screen shot Diagram.

After Written the Docker file Now build it with the following commands it includes in 1/8 Steps which i have Mentioned int the Screen shot Diagram.

14 Now check the docker images of Flask app and Python which we have mentioned in the Docker file with the below command.
Now check the docker images of Flask app and Python which we have mentioned in the Docker file Diagram.

15 Now Run the docker Container with the help of Docker images with Port Number with the help of Below command.

Now Run the docker Container with the help of Docker images with Port Number with the help of Below command Diagram

16 Now open the Port in our Security Groups for the Incoming Traffic and allow port no 5000.
16 Now open the Port in our Security Groups for the Incoming Traffic and allow port no 5000.

17 To confirm the Docker Container of Flask App is Run or not use these command.

To confirm the Docker Container of Flask App is Run or not use these command diagram

18 Now Access the app with the help of Public IP of Ec2 Instance with port no here is the Syntax:-
18 Now Access the app with the help of Public IP of Ec2 Instance with port no here is the Syntax Diagram.

20 We need to create a docker network 2tier to connect mysql Container and MySQL Database.

We need to create a docker network 2tier to connect mysql Container and MySQL Database Diagram.

21 As per the Diagram need a MySQL Container with username and Password use these command to run I have use the Environment Variable in these
with -e

As per the Diagram need a MySQL Container with username and Password use these command to run Diagram.

22 As per the Diagram need a MySQL Database username and Password use these command to run I have use the Environment Variable in these with -e
and run the mysql image latest .
As per the Diagram need a MySQL Database username and Password use these command to run I have use the Environment Variable in these with -e and
run the mysql image latest Diagram.

23 Check the Both Containers which are Run with the command.

Check the Both Containers which are Run with the command Diagram.

24 Check the Network of Both Containers with these command

24 Check the Network of Both Containers with these command Diagram.

25 Now Inspect the both container on Network with the help of below command.
Now Inspect the both container on Network with the help of below command Diagram.

26 Now your MySql Container and MySql Database connected with each other here is the Diagram of Connectivity with Ipaddress:5000
Now your MySql Container and MySql Database connected with each other here is the Diagram of Connectivity with Ipaddress:5000 Diagram.

27 Create the Message table in your MySQL Database but before create a table access the MySql Database and then enter in the mysql with the following
commands.
Create the Message table in your MySQL Database but before create a table access the MySql Database and then enter in the mysql with the following
commands Diagram.

28 Check the Databases, use mydb and then create a table with the help of following commands. use the syntax direct copy and paste in your terminal.
28 Check the Databases, use mydb and then create a table with the help of following commands. use the syntax direct copy and paste in your terminal
Diagram.

29 After Creating the table access your 2-Tier Flask Deployment App on your browser: with the help of Following syntax:-

After Creating the table access your 2-Tier Flask Deployment App on your browser:- Diagram

Hope I helped you in understanding the concept in a better way!!


Happy Learning !!

You might also like