Assume that you have a good idea :
You have then started coding your idea:
After few hours, websitev1.0 is ready to launch
Your website is locally hosted now:
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.
Now your code has a server and an IP address.
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:
You can now post it on socials and you are a famous guy now:
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.
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.
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.
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.
Still we need the dependencies every single time the CI/CD pipeline runs.
So, here comes container.
We can keep all our dependencies in the container and then just copy it and use it.
Every time CI/CD pipelines work, it will now use containers to build the application.
You can easily run multiple container in isolated ways.
Now, as your website is famous, you need to increase more and more servers.
But if any container fails or not in use, its hard to manually stop them all the time.
For that reason, Orchestration came up.
So, this is what it will look now:
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.
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.
the terraform file may look like this:
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.
Terraform is mostly used for provisioning and Ansible is used for post provisioning.
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.
So, overall every time we have to go through this process.
So, this is what DevOps is.
You may also learn these using KodeKloud's DevOps Pre-Requisite Course
Top comments (0)