DevOps Pre-requisites (Part 1)
Tags: devops
Published: 2023-02-25 10:24:03

Assume that you have a good idea :

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jqjod744unnaym697mrc.png)
You have then started coding your idea:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p85i7by1m45zfad7xs25.png)

After few hours, websitev1.0 is ready to launch

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kiyblmhbz03quzg92ils.png)
Your website is locally hosted now:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h0rbg3hdx5fkenn4wun7.png)

Folks from online can never reach this. Thus we have decided to upload our codes to a cloud server and share our code along side dependencies to run it.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s10qvcwfjkjqfjj84gel.png)
 Now your code has a server and an IP address. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8utb4po5gmeydjpuqql3.png)
You can call that environment your production environment used for production.

You can call your local system the development environment.

You have now bought a domain name and kept it for your IP:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/squr4nwk7u1ydeps5gcl.png)

You can now post it on socials and you are a famous guy now:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fdyycg7qdl8n786hcexk.png)

So, what just happened?
You have developed codes and then built it . As codes can not run without building, you can build them using scripts.


Then you have run that on your servers.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dc14p6ju6u50439rnmia.png)


So, Development --> Build --> Deploy.

These are the 3 stages.
 Your website is famous now and you need to add more features and you have hired developers now.

They need to share codes and work on different features, for that Git is there to help.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5wxz8c8f20tekfw1ynpn.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o4lepypdni8vjx0myvac.png)

Previously we built our codes when we had just 1 person coding but now we have so many folks working and each code needs to be built.

So, we have taken a server where all the codes will come in and get built.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5i7gwqsrekxz5sj44cb0.png)


So, manually each code is built and then tested and taken to the production environment.

It's really tough to do things manually.

But we have CI/CD pipelines which can automate our process of building, testing and deployment.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/22t1hisxiquelfl5n5o4.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ug2zvo0llxystb9g8e8v.png)

Still we need the dependencies every single time the CI/CD pipeline runs.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bb3jbehvr7jtq2k448y7.png)


So, here comes container.

We can keep all our dependencies in the container and then just copy it and use it.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o29t2hp9zq2c99lkws2g.png)

Every time CI/CD pipelines work, it will now use containers to build the application.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dv1x3cepy7tkuig73zkn.png)
You can easily run multiple container in isolated ways.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/voxgft0hyent4pwusgpl.png)



Now, as your website is famous, you need to increase more and more servers.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/24oawj8yzi1ng45nqips.png)
But if any container fails or not in use, its hard to manually stop them all the time.

For that reason, Orchestration came up.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/egvjp7rcmzyftasixrye.png)
So, this is what it will look now:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/phv8ytmpt7x9dlcfwwxj.png)

Now, when a new server comes up , we need to manually add that to our system. This is really time consuming . This server will have all the resources just like we have provided to other servers.
 So, to solve this issue, we have Terraform.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0js58eerdm4u66ktflvp.png)

it ensures that servers in cloud have the right configuration. If someone manually changes one server's configuration which should not be up there, Terraform then changes that automatically.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lgj4it8tqpdchw987125.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uitvy8tnewni9alenk06.png)

the terraform file may look like this:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lokpsvzahrbj2u340w4i.png)

As the configuration is mentioned just like code, it is generally mentioned as Infrastructure as Code (IaC)
But there is also Ansible which can help automated infrastructure once provisioned.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dyapjz4vq495930adpdx.png)

Terraform is mostly used for provisioning and Ansible is used for post provisioning.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2010u68ki15j8hf5ywaw.png)
This is how Ansible codes will look like.

Now, you have to think about monitoring. For that Promethus comes in.
And for visualizing things graphically, Grafana comes in.
So, Promethus basically collects data , log , metrics and Grafana makes graphs to visualize it.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jrejp9jdxr97zygbd7nc.png)

So, overall every time we have to go through this process.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e2oy09l894bgrtbtdrxa.png)


So, this is what DevOps is.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0d9645y6rtx1klwiump6.png)


Done for this blog!
<img src="https://media.giphy.com/media/26ufdipQqU2lhNA4g/giphy.gif">

You may also learn these using [KodeKloud's DevOps Pre-Requisite Course](https://kodekloud.com/topic/devops-tools/)