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

How to use Docker, Kubernetes and Azure DevOps to implement DevOps

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article shows you how to use Docker and Kubernetes and Azure DevOps to achieve DevOps, the content is concise and easy to understand, can definitely brighten your eyes, through the detailed introduction of this article, I hope you can get something.

We will decompose all the knowledge you want to know about DevOps, so you can start building your own CI/CD pipeline.

Focus on DevOps.

What is DevOps? How is it different from Agile? What are the popular DevOps tools? What roles do Docker, Kubernetes and Azure DevOps play in DevOps? Let's start with a simple usage scenario.

What is DevOps?

Like most buzzwords around software development, there is no accepted definition of DevOps.

To put it simply, it can be described in the following two paragraphs, which is complex enough to write a whole page in the book.

DevOps is a combination of cultural concepts, practices, and tools that enable an organization to improve its ability to deliver applications and services efficiently. -Amazon Web Services (AWS)

DevOps is a concept of interdisciplinary collaboration within an organization that automates the delivery of new software versions to ensure their correctness and reliability. -L Leite

Instead of trying to define it, let's take a look at how software development has evolved into DevOps step by step.

Waterfall model

The first decades of software development revolved around the waterfall model.

The waterfall software development model is similar to the actual development of real estate projects-for example, building an amazing bridge.

You need to build the software in multiple phases, which can last from weeks to months.

In most waterfall projects, it takes months for an enterprise to wait for a working version of the application.

Key factors in building excellent software products

After decades of using the waterfall model, we realized some key factors in developing great software:

Communicate

Feedback

Automation

The importance of communication

Software development is an interdisciplinary work involving multiple skills.

Communication between people plays a vital role in the success of software projects.

In the waterfall model, we tried to enhance communication by preparing up to 1000 pages of documentation on requirements, design, architecture, and deployment.

However, after using it for a while, we realized

The best way to enhance communication within the team is the cohesion of the team. And the ability to acquire a range of skills on the same team.

Cross-departmental teams (with more skills) do a better job.

The importance of feedback as soon as possible

It is important to get feedback as soon as possible. To build good software is to get feedback as soon as possible.

Can the software we develop meet the market expectations?

You can't wait months to get feedback. You want to know as soon as possible.

Will there be a problem with your application if it is deployed to a production environment?

You don't want to wait months to know the result. I'm sure you want to know as soon as possible.

The sooner you find a problem, the easier it will be to fix it.

We find that excellent software development teams can get feedback quickly. For the features I have developed, I need to know as early as possible whether I am doing these things in the right direction.

The importance of automation

Automation is very important. Software development includes many aspects of activities. Doing these things manually is inefficient and error-prone. We understand that it is important to seek opportunities to introduce automation.

After understanding the key factors in how to develop great software, let's take a look at how we got to Agile and DevOps.

Develop to Agile

Agile is the first step for us to improve communication between teams, get feedback and introduce automation into our learning content.

Agile integrates business and R & D teams into one team to develop excellent software in a small iterative process called Sprint.

Instead of spending weeks or even months in each development phase, Agile focuses on dealing with small requirements called user stories throughout the development cycle for days or even days.

How does Agile facilitate communication between teams?

Agile integrates the business with the R & D team.

The business team is responsible for defining what kind of product to develop. What kind of needs do you have?

The development team is responsible for developing products that meet these requirements. The development team includes people who design, code, test, and package applications.

In Agile, the business representative, the product manager, always appears on the team to make the team clear about specific business goals.

When the development team does not understand the requirements well or is in the wrong direction, the product manager will help them make corrections to help them get back on the right track.

The result: the final product developed by the team is the product that the market finally needs.

Another important factor is that the Agile team has cross-functional skills: coding skills (front-end, API and database), testing skills, and business skills. These facilitate communication among people who need to work together and develop excellent software.

Agile and Automation

What aspects of the Automation area does the Agile team focus on?

Software products have a variety of defects:

A functional defect means that the product does not function as expected.

Technical defects can make it difficult to maintain software. For example, code quality issues.

Overall, the Agile team focused on using automation to identify technical and functional defects as early as possible.

The Agile team focuses on automated testing. Write excellent unit tests to test your methods and classes. Write excellent integration tests to test your modules and applications. The Agile team is also very concerned about code quality. Tools such as SONAR can be used to evaluate the code quality of an application.

Is it enough if you have excellent automated testing and excellent code quality checks? You may want to run them often. The Agile team focuses on continuous integration. You submitted a change to the version control system. Run unit tests, automated tests, and code reviews. These are running automatically in the continuous integration pipeline. In the early stages of Agile, the more popular CI/CD tool was Jenkins.

How does Agile improve fast feedback?

An important factor is that the market does not have to wait months to see the final product. At the end of each iteration, the product is demonstrated to stakeholders, including the architecture and business team. All feedback will be treated as a priority user story for the next iteration. The result: in the end, the software developed by the team is what the market needs.

Another key factor for quick feedback is continuous integration. For example, I submit some code to the version control system. In less than 30 minutes, I can get feedback if the code causes unit and integration tests to fail. I also get feedback on code that does not meet code quality standards or does not have enough unit test code coverage.

Is Agile successful? That's for sure. Agile takes software development to the next level by focusing on improving communication between the market and the development team and identifying problems early.

Personally, working with some exciting teams in the Agile model is a wonderful experience. Software engineering, to me, means the result of all the efforts made from the requirements to the final use of the application, and for the first time, I feel that programming is a pleasure.

But has the pace of development stopped? No.

A new challenge has emerged.

The change of micro-service architecture

When we tried to move to a micro-service architecture, we began to develop small API rather than large applications.

What are the new challenges?

Operation and maintenance has become more important. Instead of releasing one version a month, hundreds of small microservices are released every week. It becomes very important to debug the problems of microservices and to figure out how microservices work.

At that time, software development gave birth to a new buzzword. DevOps .

The emergence of DevOps

What is the main focus of DevOps?

DevOps focuses on improving communication between the development team and the operation and maintenance team.

How can we make development easier?

How to make the work of the operation and maintenance team look more transparent in the development team?

How does DevOps improve communication between teams?

DevOps shortens the gap between the operation and maintenance team and the development team.

In more mature companies, operations and development teams are like a team. They begin to share common goals and understand each other's challenges.

For some enterprises that have just started to switch to DevOps, representatives of the operations team will participate in the Sprint-both site meetings and reviews.

What aspects of automation will DevOps focus on?

In addition to the areas that Agile focuses on (continuous integration and automated testing), the DevOps team focuses on helping automate some of the operations team's activities, such as configuring servers, configuring software on servers, deploying applications, and monitoring production environments. There are some key terms that are continuous deployment, continuous delivery, and infrastructure is code.

Continuous deployment refers to the deployment of a new version on a test environment. Even in mature companies such as Google and Facebook, continuous delivery may deploy hundreds of versions to a production environment every day.

Infrastructure or code is to treat your infrastructure in the same way as your application code. You use configuration to create these infrastructures (servers, load balancers, and databases) in an automated way. You need to version control your infrastructure so that you can track infrastructure changes later.

How does DevOps improve immediate feedback?

DevOps integrates the operations team and the development team. Because the operation and development team is part of a team, the whole team is aware of the challenges related to the operation and development team.

Any operational problem can be noticed by the developer.

Any challenge to the online software will be noticed by the operation and maintenance team as soon as possible.

DevOps encourages continuous integration, continuous delivery, and infrastructure as code.

Because of the use of continuous delivery, if I make a code change or a configuration change that may block testing or a staging environment, I will know in a few hours.

Because of the use of infrastructure, namely code, developers can configure the environment, deploy the code, and discover problems without the help of the operation and maintenance team.

Although we talk about Agile and DevOps as two different things that make things easier, in fact, there is still no accepted definition of what DevOps means.

I see Agile and DevOps as two stages that help us improve how to develop great software. They are not competitive, but working together can help us build amazing software products.

As far as I'm concerned, Agile and DevOps are used together for a specific purpose.

Improve communication among marketing, R & D and operation and maintenance teams

Slow down the pain points of automation. During the wonderful journey of this course, we will discuss unit testing, integration testing, code quality checking, continuous integration, continuous delivery, infrastructure as code, and standardization through containers.

A DevOps story.

It is said that there is an amazing story:

You are the star of development on the team, and then you need to fix a bug quickly. You need to go to GitHub and have a look!

Quickly check out the project code.

Quickly create a local environment.

A change was created. And the test is over. Unit tests and automated tests are then updated.

Submitted.

You get an email saying that it has been deployed to QA.

Some integration tests are running automatically.

Your QA team received an email requesting a test. They started the manual test and then passed.

Your code will be online to the production environment in a few minutes.

You may have an ideal scenario for thinking about it. But what you need to know is that this is what happens every day at innovative companies such as Netflix, Amazon and Google!

This is the story of DevOps.

DevOps = Development + Operations

DevOps is a natural evolution of software development. DevOps _ is not just a tool, a framework, or just automation. It's a combination of these things.

DevOps focuses on people, processes, and products. People in DevOps refer to culture and creating a great mindset-a culture that promotes open communication and rapid feedback, a culture that creates high-quality software.

Agile helps build bridges between the market and the development team. The development team understands the priorities of the market and works with the market to deliver the most valuable stories. However, Dev and Ops are not consistent.

They have different goals.

The goal of the Dev team is to add as much functionality as possible to the product.

The goal of the Ops team is to keep the production environment as stable as possible.

As you can see, if it is so difficult for the product to enter the market, the development and operation teams will not be able to reach an agreement.

The goal of DevOps is to bring the Dev and Ops teams together through some of the same goals.

The Dev team works with the Ops team to understand and solve the challenges encountered in operation and maintenance. The Ops team is part of the Scrum team that can learn something about development functionality.

How can we make it happen?

Break the gap between Dev and Ops!

Dev Ops together-scenario 1

In a mature DevOps enterprise, Dev and Ops share responsibility with each other as part of the scrum team.

Dev Ops together-scenario 2

However, if you are in the early stages of moving to DevOps, how do you get the Dev and Ops teams to share a common goal and work together?

Here are some things you need to do:

The first thing you can start to do is get the operations team to share some work tasks with the development team. For example, the development team can be responsible for the release of a new version a week after the product is launched. This can help the development team understand the challenges faced by the operation and maintenance team in launching the new version and can help them explore better solutions.

Another thing you need to do is to involve a member of the operation and maintenance team in the daily activities of Scrum. Let them attend the team's station meeting and wrap-up meeting.

The next thing you can do is to make the problems faced by the operations team more clearly presented to the Development team. When you have problems with operations and maintenance, you can make some members of the development team part of the solution team.

No matter what you want to do, find a way to break the gap between the development and operations teams working together.

Another interesting scenario arises because of automation. By using the infrastructure, the code, and the developer's own configuration, you can create a language-code that both developers and operators can understand. The details will be explained in the following steps.

A DevOps usage scenario

Think about the following picture:

This picture shows two simple workflows.

No 1: use Terraform and Azure DevOps to configure the infrastructure or code for Kubernetes.

No 2: continuous deployment of microservices: using Azure DevOps to build and deploy Docker images of microservices to Kubernetes Cluster

Sounds complicated, doesn't it?

Let's try to break it down and then understand it.

Let's start with No 2-continuous deployment.

Continuous deployment of DevOps using Azure DevOps and Jenkins

What good are they if you have excellent tests and code quality checks but don't run them often?

What's the use of software if you have automated deployment but don't deploy it very often?

As soon as the developer submits the code to the version control system, the following steps are performed:

Unit testing.

Code quality check.

Integration testing.

Application packaging-launch a new application or launch a new version of the application.

Send the test application email to the test team

Once approved by the test team, the application is immediately deployed to the next environment.

This is called continuous deployment. If you continue to deploy to a production environment, it is called continuous delivery.

The most popular CI/CD tools are Azure DevOps and Jenkins.

No 1: using Terraform to implement DevOps infrastructure as code

In the past, we manually created the environment and deployed applications.

Each time you create a server, these need to be done manually.

What if the Java version needs to be updated?

Do you need to apply a security patch?

You need to do it manually.

The result?

It's very likely that something will go wrong.

It is very difficult to replicate the environment.

Infrastructure is code

Infrastructure is code-equates infrastructure with application code.

Here are a few important knowledge points for understanding the infrastructure, that is, the code.

The infrastructure team focuses on work that adds value (rather than day-to-day work).

Fewer mistakes can recover from failure more quickly.

The server is consistent (avoiding Configuration Drift).

The most popular IaC tools are Ansible and Terraform.

Generally speaking, there are several steps in IaC

Configure the server from a template (enabled through Cloud)

Install softwar

Configuration softwar

Server configuration

Generally speaking, the configuration tool is used to configure the server to make the server have network function. The most popular configuration tools are CloudFormation and Terraform.

With Terraform, you can configure servers and other infrastructure, such as load balancers, databases, network configurations, and so on. You can create servers using pre-created images like Packer and AMI (Amazon Machine Image) tools.

Configuration management

Configuration management is used to

Install softwar

Configuration softwar

Popular configuration managers include Chef, Puppet, Ansible, and SaltStack. These are designed to install management software on existing servers.

The roles of Docker and Kubernetes in DevOps

What are the roles of Docker and Kubernetes in DevOps?

In the microservice world, some microservices are built using Java, partly with Python and partly with JavaScript.

Different microservices are also different in building applications and deploying to servers.

This makes the work of the operation and maintenance team very difficult.

How can we find a similar way to deploy multiple types of applications? Let's talk about containers and Docker.

With Docker, you can build micro-service images-regardless of the language. You can run these images in the same way on any infrastructure.

This simplifies the operation.

Kubernetes adds the ability to orchestrate different kinds of containers and deploy them to clusters.

Kubernetes also provides:

Service discovery.

Load balancing.

Centralized configuration.

Docker and Kubernetes make DevOps easier.

Important DevOps indicators

Here are a few important DevOps metrics that you can track and improve over time.

Deployment frequency-how often will the application be deployed to the production environment?

Time to market-how long does it take to code a feature to the final product?

Failure rate of new releases-how many releases failed?

Repair time-how long does it take from the need to fix the product problem to the release to the production environment?

Average recovery time-how long does it take for the production environment to recover from a critical issue?

DevOps best practices

Here are some DevOps best practices

Standardization

A team with cross-departmental skills

Focus on culture

Automation, automation, or automation

Constant infrastructure

Development and production is equivalent

Version controls everything.

Self-configuration

A sign of DevOps maturity

How should the maturity of DevOps integration be measured? Here are some key questions that need to be answered.

Development

Does each submission automatically trigger automated testing and code quality checks?

Has your code been continuously distributed to the production environment?

Do you use pair programming?

Do you use TDD and BDD?

Do you have many reusable modules?

Can the development team configure the environment itself?

How long will it take to quickly fix problems in the production environment?

test

Do you use high-quality data similar to the production environment to perform complete automated tests?

Does your build fail when your automated tests fail?

Do you have a short test cycle?

Do you have an automated NFR test?

Deployment

Do you have the same development and production?

Did you use the ABG B test?

Do you use canaries to deploy?

Can you press the button to start the deployment?

Can you press the button to perform a rollback?

Can you configure and publish the infrastructure at the press of a button?

Can you use IAC and version control for your infrastructure?

Monitor and control

Does the team use a centralized monitoring tool?

Can the development team get the log at the press of a button?

Can the team automatically receive an alarm when there is a problem in the production environment?

Team and proc

Does the team seem to be improving continuously?

Does the team have all the skills of business, development, and operations?

Does the team track key metrics of DevOps and improve them?

Do you use local discoveries and use them to further achieve a globally improved culture?

The above content is how to use Docker and Kubernetes and Azure DevOps to implement DevOps. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

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