DEV Community

Cover image for DevOps Pre-requisites (Part 1)
Shahriyar Al Mustakim Mitul
Shahriyar Al Mustakim Mitul

Posted on

DevOps Pre-requisites (Part 1)

Assume that you have a good idea :

Image description
You have then started coding your idea:

Image description

After few hours, websitev1.0 is ready to launch

Image description
Your website is locally hosted now:

Image description

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
Now your code has a server and an IP address.

Image description
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

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

Image description

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

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

Image description

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

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

Image description

Still we need the dependencies every single time the CI/CD pipeline runs.
Image description

So, here comes container.

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

Image description

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

Image description
You can easily run multiple container in isolated ways.

Image description

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

Image description
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
So, this is what it will look now:

Image description

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

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

Image description

the terraform file may look like this:

Image description

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

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

Image description
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

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

Image description

So, this is what DevOps is.

Image description

Done for this blog!

You may also learn these using KodeKloud's DevOps Pre-Requisite Course

Top comments (0)