DevOps - DevOps Essentials - change


Special Note

This article is a summary of study notes and read books, there are a small number of changes to the original content, and add some information, but generally does not affect the original expression.
"DevOps entry and Practice": This book combines detailed examples of how the process of introducing DevOps development site.
- ISBN: 978-7-115-51256-7
- https://www.ituring.com.cn/book/2407

Personal Comment

Suitable have practical experience in the implementation of staff, existing knowledge and skills to make structural comb.
DevOps lack of suitable personnel to understand and be able to establish the basic concepts.
Shortcoming is because foreign language books translated reason there is a time difference of introduction, some examples of tools and methods involved in the book, behind the current mainstream scenarios.
In addition, DevOps ultimate realization of the structure of the book, only to meet the principles of the demonstration process, relative to the current mainstream business needs, too simple, does not have the big practical value.


How to DevOps framework for change centered on the successful implementation of DevOps?

DevOps core elements

  • Soil --- "organization ---" building and training of personnel
  • --- thought to form a "culture ---" conscious
  • To establish a method --- "process ---" rule
  • Tools --- "Operation and Configuration ---" automation, intelligent evolution

1-- Applications

1.1 learn from existing practice patterns

On DevOps soil, will the current business and DevOps ideas, methods and tools combine the best reference to existing best practice models to guide practice.
This will be achieved circumvented part of possible problems, mainly time and energy should not be spent on another one problem.

The Twelve-Factor App

  • https://12factor.net/zh_cn/
  • Software is usually delivered as a service, 12-Factor provides a methodology for building SaaS applications as for any language services and back-end applications (databases, message queues, buffers, etc.) development.
    - 使用标准化流程自动配置,从而使新的开发者花费最少的学习成本加入这个项目。
    - 和操作系统之间尽可能的划清界限,在各个系统中提供最大的可移植性。
    - 适合部署在现代的云计算平台,从而在服务器和系统管理方面节省资源。
    - 将开发环境和生产环境的差异降至最低,并使用持续交付实施敏捷开发。
    - 可以在工具、架构和开发流程不发生明显变化的前提下实现扩展。

1.2 Micro Services

Micro-service architecture is a single application as a method to develop a set of small service.
9 feature micro-services: service component of, to function as the center of business organization team, the attitude of doing product, service endpoint, distributed control, distributed data management, infrastructure automation and fault tolerance and evolutionary design.
Each small business services are to function as a unit to build, automated deployment mechanism for independent deployment, and run as a separate process, using a lightweight HTTP API resources and other ways to communicate between different processes.
Each process independent of each other, so in centralized management while maintaining a minimum, each service can take different programming languages and storage to achieve.
In short, micro-service architecture with the business units to function as a large service into multiple smaller processes, constitute a complete set of services provided by these small processes can easily be added to each small process functions , modified and reused operations.
Corresponding in the organizational structure, each individual process is implemented by a team comprising different skills of staff.

2 - infrastructure

2.1 immutable infrastructure (immutable infrastructure)

As the name suggests, its main meaning is no longer any change in the infrastructure building after completion.
If you want to operate on the environment, we need to destroy existing infrastructure and then create a new infrastructure.
In other words, be able to abandon the existing infrastructure and rebuild from scratch the same as the original infrastructure.

The main advantages

  • Prevent accidents: Keep a clean state of the environment, to avoid the mistakes of the configuration and operation of the root causes
  • Ease of management: do not need to manage the configuration and status of the operating environment
  • Infrastructure enforce the code: the code up to date real-time feedback to the infrastructure
  • Troubleshooting and unified configuration changes work steps: boils down to an automated "reconstruct"

Of particular concern where

  • In general, the infrastructure can not be changed only for stateless server (without changing data or configuration), not to have such a state similar to the DB server.
  • Under special needs need to retain the infrastructure, for example, investigate the cause of the failure analysis
  • When rebuilding infrastructure, related to the monitoring server configuration also requires a corresponding operation
  • Select the tool and develop practical solutions based on the specific application scenarios

2.2 blue-green deployment (Blue-Green Deployment)

Blue-green deployment is to solve the problem of traditional publishing and emerging.

  • Services need to pause when released, affect the availability
  • After the release takes a long time to repair failed

In principle, the blue-green deployment is to solve the problem through redundancy.

  • Production environment by the blue and green components of the environment, at the same time can only use one
  • In environments that are not used and publishing business test operation, the test passes via the DNS, the load balancer, the reverse proxy, routing, etc. to quickly complete a context switch.
  • If a failure occurs, it can also load balancers, reverse proxy, routing, etc. to quickly fall back to the previous version

Fast switching speed the deployment of blue-green, even if a failure occurs, it can be easily rolled back version, hardly affect the user.
But there are some restrictions, it is the need to maintain a dual infrastructure, and does not apply to the state server.

2.3-premises and cloud

DevOps implementation does not require a specific type of environment, but depending on local conditions recommended conditions.

Local Deployment

  • Purchase or lease of hardware resources placed in the data center, and are responsible for maintaining almost all the work is completed in-house
  • Independent and strong, you have complete control of the equipment and services
  • Need to invest adequate human, material and financial resources to build and maintain

Public cloud

  • By cloud computing cloud service provider managed IaaS (Infrastructure as a Service, Infrastructure as a Service)
  • Quick access to resources, to deal with high load
  • Easy management, the current mainstream platform provides API, command-line tools, and other tools Management Console
  • Must be constructed and used in accordance with the service provider and the plan
  • Troubleshooting is limited to the virtual machine level public cloud platform

Private Cloud

  • Use OpenStack deployment in the local environment, such as cloud computing platform immutable infrastructure,
  • Now the premise of the need to build an infrastructure of local IaaS deployment environment, difficult to achieve, but also to spend time and money

2.4 software as a service (Software as a Service, SaaS)

For non-core functions and services not directly related, you can choose to implement Internet-based service, completely non-core part of cost-cutting.
For example, in the range of continuous integration, there CircleCI and Travis CI and so on.
If the SaaS service provides functionality more important, the greater the need for rigorous validation prior to use and to develop appropriate contingency plans (disaster, failure of response plans)

SaaS benefits

  • Wiki servers shipped by the service provider responsible for this
  • Intuitive and simple operation and configuration
  • The timely provision of related support middleware

SaaS shortcomings

  • SaaS services can not be controlled failure
  • Difficult to provide customization
  • Price set by the service provider and service

2.5 log collection

In DevOps, the log is in addition to the collection and storage should also be actively used for analysis.
In the case of immutable infrastructure is the most ideal way real-time log collection, processing and output show.
Use ELK technology stack (Elasticsearch, Logstash and Kibana), can quickly transfer the log, analyze and visualize (numerical and graphical information), helps objective determination.
By continuously log analysis and visualization, be careful thought and reflection on the current situation, by improving iterative and ultimately achieve long-term goals.

  • Elasticsearch: has a good real-time performance and scalability JSON-based distributed search and analysis engine as a core ELK, centralized data storage
  • Logstash: Dynamic data collection conduit to collect and process data in various ways and in various forms and outputs transmission, data can be imported into the visualizer
  • Kibana: ELK user interface, aggregated, and data analysis and search Logstash ElasticSearch provide and visualize, and provides an interface to configure and manage ELK

3 - Team

3.1 agile development (agile development) and DevOps

Agile development is a method developed by improving the methods and team structure, continuous improvement of the final outcome.
Development success is not whether released as planned on time service, but rather whether the development of services can cope with change, whether or not a commercial value.
In order to respond rapidly to changes in targeting agile development, planning, design, development, testing, and publishing and other related work by a small team to complete.
Thus continued to improve in the short term by repeating this series of work, accept outside feedback on services and products.
All members are responsible for services and products, need to understand each other's business, naturally formed a pattern DevOps need.

3.2 Ticket drive

Use JIRA, Redmine and Trac and other bug tracking systems or issue tracking system in the software development process, as a unit with ticket problems, defects and agile development method for managing user stories are.
DevOps practices as a good complement to solve the problem of document management information is scattered, it can support the development from the waterfall to Scrum development.
In DevOps, the units through ticket information sharing and task management, will make coordination easier between internal and external information and easier centralized management.

In the specific implementation, is that all tasks include code changes are carried out in a manner ticket management, be associated with specific matters and related personnel, synchronization status update.
It can include all kinds of ticket date, person in charge of information, details and discussion records.
It provides dashboards (Dashboard), may grasp the overall situation of the development from project management, effort estimation and schedule management perspective.

3.3 Site Reliability Engineering (Site Reliability Engineering, SRE)

Based on Google's long-term operation and maintenance practices proposed, focusing on operation and maintenance, it can be said SRE is a more specific description of the operation and maintenance of DevOps.
Although the decline in the reliability of the site does not directly impede the realization of commercial value, but the probability of a substantial increase in the risk of disruption.
SRE team to ensure that under conditions of limited resources SRE, technology is very difficult, demanding improved skills.

Improving the mainstream approach and views of SRE

  • System optimization: availability, latency and performance
  • Monitoring: service, capacity
  • Built-quality: automation, change management
  • Troubleshooting: Recovery Mechanism

3.4 ChatOps

For a variety of tasks to improve efficiency through instant messaging, real-time to ensure that team members are able to understand the current situation and others operating systems.
Communication tools can do the integration of all types of information, such as CI & CD tools, Web services.
Slack, (chat tools, third-party tools may be integrated) and Hubot (bot) ChatOps achieve a representative composition.

  • The difficulty of unified communication, simplify communication channels and reduce the preparation and transmission of information
  • Intelligent and efficient operation, for example, only need to enter a command in the communication tool to complete the assigned work or to obtain specific information
  • Process and results (real-time visibility, record visible) visible to everyone
  • Conducive to the notification to view and review, for example, send critical information instantly, unified timeline shows all relevant information, communication and record-keeping, etc.

Use ChatOps automation and efficiency

  • Task operation: application building and deployment, testing,
  • View System Resources
  • Critical information (major changes, fault alarm, etc.) notice
  • Operation or timed reminders

ChatOps composition

  • Chat system for communication
  • Reading information from the chat system, and performs a corresponding operation of the robot system

ChatOps stage

  • Chat tool to receive notifications, team members based on the notification to communicate (System - "chat -" people)
  • Operation command issued by the chat, the specific operation of embodiment (al - "chat -" systems)

Guess you like

Origin www.cnblogs.com/anliven/p/11870155.html