当前位置:网站首页>Interpreting cloud native technology

Interpreting cloud native technology

2022-07-06 18:33:00 Hua Weiyun

The cloud based technology system seems to be complicated , But in different perspectives “ Pull one hair and move the whole body ” The main line . From the timeline , The development of container technology has given birth to the idea of cloud nativity , At the bottom, we solved the problem of resource supply , Then open source Kubernetes Become a standard specification for container choreography , When based on Kubernetes Open application platforms with extensible capabilities are gradually enriched , Making it the most important cornerstone of cloud native Ecology . And then Service Mesh、Serverless The core idea of technology is to realize value on the business side —— Sink more capacity into infrastructure , For lightweight applications 、 The cloud offers possibilities .

From the perspective of technical requirements , Microservice architecture is the first choice to solve the problem of monomer complexity , But the overall complexity of the whole system is greatly increased , Container technology and Kubernetes The deployment of a large number of applications under the microservice architecture is solved respectively 、 And container management and scheduling , meanwhile ,Kubernetes Also for the Service Mesh Provides better underlying support , It also brings about the development of the underlying infrastructure Serverless With the further development of cloud computing and middleware capabilities .

image


Cloud native underlying technology

Containers

The container is to divide the process into an independent space effectively , Technology to balance resource use conflicts between independent spaces . Essentially , A container is a special process , Its core function is to create a “ The border ”, Besides , Its ability to limit resources 、 And based on the mirror function “ Strong consistency ”, All of these make container technology one of the most critical underlying technologies of cloud nativity .

Docker Because container has isolation effect similar to virtual machine , And it's often called ” Lightweight “ Virtualization technology , But it's not rigorous . In virtual machine ,Hypervisor It's the main part , It's through hardware virtualization , Analog out CPU、 Memory 、I/O Equipment and other hardware , Then a new operating system was installed on these virtual hardware , namely Guest OS, Application processes running in a virtual operating system are isolated from each other .

Docker The difference with virtual machine is reflected in the different ways of process isolation ,Docker By attaching additional settings to the app Namespace Parameter to achieve process isolation , There is no real ”Docker Containers “ Running in the host , In this way “ Smoke screen ” Operation makes the process run in an isolated environment “ Containers ” Inside , The container reduces the extra resource consumption and occupation , It has great advantages in agility and high performance .

Besides , The core functions of the container also include Cgroups The ability to limit resources 、 And the mirror function .Cgroups The purpose of process group is to limit the maximum amount of resources that a process group can use , Include CPU、 Memory 、 disk 、 Network bandwidth and other resources . The mirror function enables container technology to show “ Strong consistency ”, That is, the image content downloaded from any place is exactly the same , Complete reproduction of the original image maker's complete environment , It's through “ Development - test - Deploy ” And so on , Making container technology the mainstream way of software distribution .

Arrange and manage

Kubernetes

When container mirroring becomes the industry standard for application distribution , The ability to define container organization and management specifications “ Container arrangement ” Technology becomes the key value node of the whole container technology stack . The main container choreography tools include Docker The company's Compose+Swarm Combine 、Mesosphere The company's Mesos+Marathon Combine 、Google And RedHat Company led Kubernetes project 、 And based on Kubernetes Built OpenShift and Rancher project . Final ,Kubernetes The project relies on excellent openness 、 Scalability and an active developer community , Stand out in the battle of container choreography , It has become the de facto standard for distributed resource scheduling and automatic operation and maintenance .

Kubernetes The main design idea of the project is , From a broader perspective , Define the relationships between tasks in a unified way , And leave room for supporting more kinds of relationships in the future . From a functional point of view ,Kubernetes Better at following the wishes of users and the rules of the whole system , Automatically handle various relationships between containers , That is, the arrangement of containers , Including deployment 、 Scheduling and inter cluster expansion . and Mesos、Swarm And other projects are good at putting a container , According to some rules , Put in the best node to run , That is container scheduling . This is also Kubernetes The important reason why the project finally stands out .

Kubernetes Core competencies

  • Service discovery and load balancing : adopt Service Resources show all kinds of application services , combination DNS And a variety of load balancing mechanisms , Support the communication between containerized applications .
  • Storage choreography : adopt plungin Support multiple storage in the form of , Like local 、nfs、ceph、 Public cloud storage, etc .
  • Resource scheduling : Set up pod Resource requirements and resource constraints for scheduling , It supports automatic application publishing and application rollback , Related configuration of management application .
  • Auto repair : Monitor all hosts in the cluster , Automatically discover and handle exceptions within the cluster , Replace the one that needs to be restarted pod node , Make the container cluster run in the user's expected state .
  • Key and configuration management : adopt secret Store sensitive information , adopt configmap Store the application's configuration file , Avoid fixing the configuration file in the mirror , Increase the flexibility of container arrangement .
  • Scale out capabilities : Implementation is based on CPU Utilization or elastic scaling based on platform level , Such as automatic increase 、 Delete nodes node .

Kubernetes The project is controlled by the control node Master And computing nodes Node form .Master As the node of control management , It's made up of three independent components working closely together :kube-apiserver be responsible for API service ,kube-scheduler Responsible for resource scheduling ,kube-controller-manager Responsible for container arrangement , in addition , The persistent data of the cluster is generated by kube-apiserver After processing, keep in Etcd in , Such as Pod、Service Equal object information . Computing node Node As the workload of the project ,kubelet Components are the core part of it , be responsible for Pod Creation of corresponding container 、 Start stop task , At the same time Master Close collaboration of nodes , Achieve the basic functions of cluster management .

Now ,Kubernetes Projects are not just the de facto standard of container technology , It has become the cornerstone of the development of the whole cloud native system , Redefining the possibilities of application choreography and management in the field of infrastructure . In the whole cloud ecosystem ,Kubernetes The project serves as a link between the preceding and the following . Right up ,Kubernetes A formatted data abstraction that exposes infrastructure capabilities , Such as Service、Ingress、Pod、Deployment, All are Kubernetes It's native API The ability to expose for users . And to the next ,Kubernetes Provides a standard interface for infrastructure capability access , Such as CNI、CSI、DevicePlugin、CRD, Let the cloud be a capability provider , Connect capabilities to... In a standardized way Kubernetes In the system . With micro Services 、DevOps And so on , be based on Kubernetes Extensible open application platform will replace PaaS The mainstream , And the value of the cloud will return to the application itself , More and more open source projects will be developed with the concept of cloud origin 、 Deployment and operation and maintenance , Finally, it directly evolves into a cloud service .

Microservices

Microservice is the product of service architecture evolution , In single architecture 、 Vertical architecture 、 Service Oriented Architecture (SOA) after , Microservice architecture (MSA) Can be regarded as SOA Distributed implementation of architecture . With business development and increasing demand , Single application functions become more and more complex , Application iteration efficiency due to centralized R & D 、 test 、 Release 、 Communication mode .

The essence of microservice architecture is to gain better agility by bearing higher operation and maintenance complexity , Its advantage lies in its small size 、 De centralization , But it also leads to the need for infrastructure 、 Cost and complexity surge .

So far, , There is no uniform standard definition of microservice , combination Martin Fowler Description of : Microservice architecture is an architecture pattern / Architectural style , Develop a separate application as a set of small services and run independently in its own process , Use... With each other HTTP API And so on . These services are built around specific businesses , Independent deployment through fully automated deployment mechanism , And it can be written in different programming languages , And different data storage technologies , And maintain a minimum of centralized management .

image

Dubbo and Spring Cloud Towards integration , More functions will be sunk into the infrastructure

  • Spring Cloud
    Spring Cloud He is the leader of the first generation of microservice architecture , It provides a one-stop solution for the realization of microservice architecture , As a family bucket technology stack , It provides a tool for developers to quickly build a common model of distributed system , Including configuration management 、 Service discovery 、 Fuse 、 Intelligent routing 、 The micro broker 、 Control bus 、 One-off token 、 Global lock 、 Leadership election 、 Distributed session 、 Cluster status, etc .
  • Dubbo
    Dubbo As a distributed service framework opened by Alibaba , Committed to providing high performance and transparency RPC Remote service invocation scenarios , as well as SOA Service governance solution . The core part contains : Telematics 、 Cluster fault tolerance 、 Auto discovery, etc .
    In recent years Dubbo The ecology is constantly improving ,2019 year 5 month ,Dubbo-go The official joining of Dubbo Official ecology , And then it came true REST Agreement and gRPC Support for , Opened the Spring Cloud and gRPC ecology ,Go Project and Java&Dubbo The interworking problem of the project has been effectively solved . today , because Spring Cloud Alibaba Appearance ,Dubbo Integrate seamlessly Spring Cloud All kinds of ecological peripheral products .

Whether it's Dubbo still Spring Cloud, Are more or less limited to specific application scenarios and development environments , Lack of support for versatility and multilingualism , And only solved the micro service Dev On the level of , The lack of DevOps The overall solution , These are Service Mesh The rise of the United States has created conditions .

As a complete solution for microservice management and communication ,Dubbo and Spring Cloud Will coexist for a long time and move towards integration , But some of the functions it provides will gradually be replaced by infrastructure . If deployed in kubernetes Microservices on Clusters , utilize kubernetes The function of service registration and discovery will be simpler ; Another example is the use of Istio framework , Traffic management and circuit breaker And other functions will be transferred to envoy agent , More and more functions will be stripped from applications and sunk into infrastructure .

Service Mesh

Service Mesh Usually translated as service grid , In the complex service topology of cloud native applications ,Service Mesh As the infrastructure layer , Responsible for the reliable delivery of requests in these topologies .Service Mesh By adding Sidecar, Sink the complex functions originally completed by the client to Sidecar in , Realize the simplification of client and the transfer of communication control between services , When there are a large number of services in the system , The invoking relationship between services is a network , This is also the origin of the service grid name .

We can use the following features to Service Mesh Give a summary of the definition of :

  • abstract : Service Mesh Separate the communication function from the application , Form a separate communication layer , And sink it to the infrastructure level .
  • function : Service Mesh Responsible for reliable delivery of requests , Functionally, it is no different from the traditional way of class library .
  • Deploy : Service Mesh In the deployment, it is reflected as a lightweight network agent , With Sidecar One to one deployment of patterns and Applications , The communication between the two is through Localhost The remote invocation .
  • transparent : Service Mesh The function implementation of is completely independent of the application , It can be deployed and upgraded independently 、 Extend the functionality 、 Fix the defect , Applications don't need to focus on Service Mesh The implementation details of , That is, transparent to the application .

Service Mesh Its core value is not only reflected in its functions and characteristics , What's more, it is to realize the separation of business logic and non business logic . Non business logic will be removed from the client SDK be stripped , With Proxy Independent process running , So as to put the original existence in SDK Various capabilities in sink to container based 、Kubernetes or VM Infrastructure of , Hosting on the cloud 、 Lightweight applications , To help with cloud protochemistry .

Mainstream Service Mesh Open source software includes Linkerd、Envoy and Istio.Linkerd and Envoy It directly reflects Service Mesh Core concept of , They are similar in function , That is to realize service discovery 、 Request routing 、 Load balancing and other functions , Solve the communication problem between services , So that the application is not aware of service communication . and Istio From a higher angle , take Service Mesh Divided into Data Plane and Control Plane, from Data Plane Responsible for all network communication between microservices , and Control Plane Responsible for managing the Data Plane Proxy, And Istio Natural support Kubernetes, This also bridges the gap between the application scheduling framework and Service Mesh The gap between .

The implementation of micro services needs a complete set of infrastructure , When the container becomes the smallest unit of work for a microservice ,Kubernetes As a general container management platform , It can give full play to the greatest advantages of microservice architecture , Make it a new generation of operating system for Cloud Computing .Kubernetes It can not only support the running of cloud native and traditional container applications , And cover Dev and Ops Stage , And Service Mesh It can provide users with a complete end-to-end micro service experience .

Serverless

Serverless take Service Mesh Application scenario generalization of , It's not limited to synchronous communication between services , It's going to be extended to having Internet access 、 Through the client SDK More scenarios to achieve , Including calculation 、 Storage 、 database 、 Middleware and other services . As in ant gold Serverless In practice ,Mesh The pattern also extends to Database Mesh( Database access )、Message Mesh( Message mechanism )、Cache Mesh( cache ) Such as the scene .

at present ,Serverless Usually seen as FaaS( Functions are services )、BaaS( Back end as a service ) Set , but Serverless Only one user experience is defined , Not some kind of Technology ,FaaS、BaaS It's just Serverless An implementation of . With Serverless Continuous maturity of Technology , More and more people use kubernetes The application of services will be transformed into Serverless application .

Cloud native middleware

Traditional middleware is similar to the water pipeline in the city , Drive and manage data flow from one application to another , Its business coupling is high 、 Can't bring direct value to users . Entering the cloud age , The heterogeneity of software 、 The demand for interconnection has increased significantly , Middleware has been given a new functional definition , That is functional independence 、 Low coupling 、 Modular components , And sink into the infrastructure , To achieve high performance 、 High availability 、 High scalability and ultimate consistency are the key components of distributed application development architecture .

From the functional definition , Middleware is a kind of computer software that connects software components and applications , It includes a set of services , In order to facilitate multiple software running on one or more machines to interact through the network , It belongs to the category of reusable software . Cloud native middleware includes API、 application server 、TP、RPC、MOM, It can also undertake data integration 、 The role of application integration , Any software between kernel and user application can be understood as middleware .

Along with IoT、 The rapid development of cloud computing technology ,EDA( Event driven architecture ) It is being adopted by more and more enterprises , Through the abstraction of events 、 Asynchronism , To provide business decoupling 、 Accelerate business iterations , It is also shifting from supporting vertical industries to common business critical application architecture , Applications are packaged applications 、 development tool 、 Business process management and monitoring .

EDA It is often implemented through message oriented middleware , Message middleware aims to use efficient and reliable message passing mechanism for platform independent data exchange , By providing messaging and message queuing models , To extend the communication between processes in a distributed environment , And the integration of distributed system based on data communication . Common message oriented middleware packages enclosed ActiveMQ、 RabbitMQ 、RocketMQ 、Kafka etc. , It can be applied to data transmission across systems 、 High concurrent traffic peak clipping 、 Asynchronous data processing and so on .

Entering the era of cloud computing , Cloud vendors provide encapsulation closer to business , Use your own Serverless Service to run the event load , The capabilities of middleware can be easily realized through cloud services , Including Alibaba cloud Function Compute、Azure Function、AWS Lambda All integrated event handling .

future , Application middleware will no longer be the provider of capabilities , It's a standard interface for capability access , The standard interface will go through HTTP、 gRPC Protocol construction , And pass Sidecar Decoupling the access layer and application business logic of the whole service , This is related to Service Mesh In the same way . further ,Sidecar The model can be applied to all middleware scenarios , In this way, middleware capabilities “ sinking ” To Kubernetes Part of capability .

DevOps

With the continuous improvement of cloud original open source Ecology 、 And complex functions continue to sink into the cloud , Basically unified the basic mode of software deployment and operation and maintenance . stay DevOps Before , Practitioners use waterfall model or agile development model for software project development .DevOps As Development and Operations The combination of , Is defined as the realization of software development and IT A set of practices for process automation between teams , These practices are based on a culture of collaboration between teams , It fills the information gap between the development end and the operation and maintenance end , So as to make it faster 、 Build more reliably 、 Test and release software , At present, it has become the mainstream software development delivery mode .

image

overall ,DevOps Contains Development 、 Testing and operation and maintenance In the third part of . Specifically , It consists of several stages : Continuous development 、 Continuous integration 、 Keep testing 、 Continuous feedback 、 Continuous monitoring 、 Continuous deployment 、 Continuous operation and maintenance , Collectively referred to as DevOps Life cycle .

DevOps The separation and combination of functions are fully reflected in the level of information flow , In development delivery testing 、 Test feedback 、 Delivery, release, etc , Providers of all kinds of information 、 The recipient uses a high quality tool system , And then realize the smooth and accurate transmission of information and efficient execution of mechanized operation .

From the above development concept ,DevOps The idea is that the infrastructure layer is not strong enough 、 Not standardized enough , So the business side needs a set of tools to bond R & D 、 Operation and maintenance personnel and corresponding infrastructure . But as the Kubernetes And infrastructure is becoming more and more complex , The original ecology of cloud will make corresponding abstraction and stratification , Each layer's role only interacts with its own data abstraction , That is the separation of concerns between the development side and the operation and maintenance side . Constantly generalizing Serverless Will also become DevOps It's an ideological orientation and component of . On the ability side ,“ Light operation and maintenance ”、“NoOps”、“ Self service operation and maintenance capability ” Will become the mainstream way of application operation and maintenance . On the application side , User side abstraction is widely used in application description , Event driven and Serverless Ideas are split and generalized , Can be applied to FaaS In a variety of scenes outside .

原网站

版权声明
本文为[Hua Weiyun]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207061017417742.html