Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What does DevOps mean?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

DevOps refers to what, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

DevOps is the simplification or automation of established IT processes. Here is a short tutorial to help you understand and get started with DevOps.

DevOps;CI/CD;Docker;Kubernetes;, I'm sure you've heard a lot about these words in the past year. It seems that the whole world is talking about these technologies, so much so that you feel like you are about to reach the NoOps stage.

Don't worry, it's normal to feel lost in a vast ocean of tools and best practices. It's time for us to analyze what DevOps really is.

What is DevOps?

DevOps is the simplification or automation of established IT processes.

I've seen a lot of people start using DevOps and end up getting lost. It seems to be a spell.

It usually starts with a video about how a high-tech startup automates the entire product launch process. Once all the tests pass, the deployment occurs automatically. When a failure occurs, it can be rolled back automatically. At the same time, we carried out the Ahand B test to improve the customer participation.

To be honest, we all want to implement such a DevOps. We're all tired of releasing new versions on a roller coaster.

Unfortunately, that's not how DevOps works. DevOps is not a magic wand, it can solve all your problems in an instant.

Instead, it's a systematic project, and you should use the right tools and techniques to accomplish different tasks.

It's all about the process.

It doesn't matter what the process is, as long as it simplifies the deployment of applications or automates testing and makes your life easier, that's what DevOps is all about.

In fact, if your process cannot be done manually (for smaller processes), you may need to redefine your process.

Well, let's give a real example to better understand the "process".

A real example of DevOps

Let's give an example of deploying a Nodejs application on a cloud virtual machine.

Process flow

Our process is as follows:

Start with the source code (Start with the source code): as long as we have access to the source code, we can run our code anywhere.

Build artifact (Build an Artifact): then we package the source code to build an artifact. If it is the Java language, then the JAR file is our product. But in our Nodejs example, the source code itself is the artifact to be released.

Publish to the product warehouse (Publish to an Artifact Repository): next, we push the product to the product warehouse. Then our virtual machine can extract products from the product warehouse. We can directly use Github as our artifact repository because our source code is an artifact.

Pull and run the application (Pull and run your app): finally, we pull the artifact to the virtual machine and start the Nodejs process by instructing npm start.

Our first DevOps project

We won't do anything fancy here. The easiest way to automate is to write a shell script that runs all commands sequentially. Congratulations on completing our first DevOps project!

I know the shell script sounds too simple to be taken seriously. I suspect you've written such a script before. But trust me, this is DevOps!

Don't worry, we'll see the fancy things soon. But it's important to understand that this is how DevOps works.

Repeatability of "repeatability"

Let me ask you a question. Which of the following do you like?

An automated deployment pipeline that works properly in 60% of the time

A boring shell script, but each execution can complete the task.

If you have ever dealt with a production failure in the middle of the night, you will choose the shell script.

The reason is simple. Reliability is far more important than automation. In other words, a DevOps process must be able to produce consistent results each time it runs.

Make our process repeatable

Take our shell script as an example. Currently, our shell script relies on Node.js installed on the virtual machine.

What happens if Node.js is not installed on the virtual machine? An incorrect version of Node.js is enough to prevent our application from running properly. When we need to install a multilingual runtime on a virtual machine, the situation only gets worse.

A simple solution is to archive the Node.js runtime in a zip file along with our source code. You can then send the zip file to the virtual machine. In this way, the virtual machine can run our application using the local Node.js runtime in the zip file.

Fortunately, there is a tool that can make our lives easier.

Docker and Container

If you are not familiar with Docker, think of Docker as a way to package your artifact and its dependent operating system, along with Node.js, into a container image.

Using containers, we can deploy any application on a virtual machine with Docker installed.

With Docker, our process would be as follows:

Containers can do more than that, but this is one of the important reasons why containers are so popular.

Docker contrast container

Let me be clear, Docker and container are not the same thing.

Docker is a set of utilities for building and shipping container images, and for running containers using the container runtime, such as containerd.

Given recent events, many people are worried about the future of Docker.

It is important to understand that Docker will not disappear immediately and will continue to play an important role in building and shipping container images.

Take DevOps seriously

We have made some significant progress. Hopefully we can understand how Docker is integrated into the DevOps process.

It's time to take things to the next level.

Event-based trigger deployment

Our script looks stable, but it is still triggered manually.

Wouldn't it be better if we could trigger this script automatically when someone pushes code to GitHub? In other words, we want event-based trigger deployment.

GitHub can call webhook on a specific set of events. To do this, we need to create a simple HTTP server that executes the shell script whenever the server receives a request. We can configure GitHub to trigger a HTTP request when a Push event occurs. We call this process continuous deployment (Continuous Deployment).

Our new process is as follows:

Congratulations, you have just successfully created a CD pipeline.

Continuous deployment is software that takes an application from something like GitHub to the target environment where it is eventually deployed.

This is basically what you often hear about CI/CD. When people talk about tools like Jenkins and CircleCI, they usually mean CI/CD.

DevOps mode

I think you've found a pattern. We start with a process, find a part that we are not satisfied with, and then introduce some software to simplify or automate it.

To operate the process in a code way, this is DevOps.

Introduction of container choreography

Finally, let's make a small improvement. So far, we have deployed the application on a single virtual machine. What if we want to deploy the application to multiple virtual machines or nodes?

The easiest way to do this is to have CD Server connect to all virtual machines through ssh and deploy the container to each virtual machine.

In this way, we need to change the script whenever the number of virtual machines changes. But in the real world, we want our applications to scale up and down automatically.

A better approach is to create another HTTP server to track changes in the number of virtual machines. We can call this server "Pilot".

This server will be responsible for performing health checks on each virtual machine in the cluster to maintain a list of active virtual machines. It can even communicate with cloud providers to make things more robust.

Pilot will also expose a HTTP endpoint to accept the details of the container to be generated. It can then communicate with each virtual machine to complete the task.

Now, our CD Server can simply request Pilot instead of communicating with each virtual machine individually.

Our new process is as follows:

We call Pilot a container choreographer. Actually, this is Kubernetes! You just designed a mini version of Kubernetes!

In addition, Kubernetes means Pilot in Greek. Is that a coincidence?

Where do we start?

We discussed a lot of tools together. This is my last point. Have you ever wondered why the space in DevOps is so scattered?

If you think about it, there are so many tools that make it difficult for you to decide: what is the right choice, or where should you start?

Each organization has its own way of doing things and processes, so they use different tools. Your job is not to find out which tool is the best. Your job is to find the process that works best for you. Once you understand this, all these tools need is Google search.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report