New function introduction it Magnum and Liberty
Container technology, especially the Docker, is one of the hottest technology recently.Docker is a Linux containers running an open source tools, a lightweight virtual machine.It helps the user provides a very effective method of operation, package and deploy applications.Container technology and promote the rapid development of container cluster management technology, including the Mesos, Google's Kubernetes, it and Docker Swarm, and so on.
Figure 1 Mesos, Google Kubernetes, it and Docker Swarm of competition
As shown in figure 1, now Mesos, Google Kuber netes, it and Docker Swarm the four open source software in cloud computing, container services in areas such as the competition is fierce, and their functions have also made some repetition, but their focus is also very obvious.Is a big difference, it mainly concentrated in the IaaS layer, the other three are mainly concentrated in the PaaS layer.Mesos goals is the next generation of data center operating system (DCOS), but now with the development of the Docker, add a lot of Mesos and Docker integration of functions, including the main service will Mesos, task running in the Docker Container and so on.Google Kubernetes is a Docker cluster management tool, mainly
provides the resource management, deployment, operation, service discovery and expansion capacity, and other functions.
It is mainly responsible for the bottom infrastructure management.Docker also add some cluster management, application management, the function of the Orchestration, and introduced a Docker Swarm, Docker Compose project, such as the corresponding community is also very active.It vancouver summit in May this year, it is proposed to do a "integration engine", at the same time it in order to ensure their position in the field of cloud computing, spent a great deal of time and energy and Docker to integration, including the Nova Docker Driver, Heat Docker Driver, it Magnum and so on.Magnum is a to it as a typical example of "integration engine", because the Magnum through it and Mesos, Google Kubernetes, Docker Swarm to integration, through container services it provides for the user.
Magnum current function is simpler, until L version, can provide users with Kubernetes - as - a - Service, the Swarm - as - aService and Mesos - as - a - Service, the user can easily manage Kubernetes, Swarm and by Magnum Mesos cluster, through the Magnum and the background of the COE (Container OrchestrationEngine, including Kubernetes, Swarm and Mesos) to interact to obtain Container services.
Figure 2 Magnum architecture diagram
Figure 2 is a Magnum architecture diagram, firstly introduce the main concepts of Magnum, in the top right-hand corner of the figure 2, there are mainly Bay, Baymodel, Node, Pod, Service, RC, Container.
Bay, Bay in Magnum main said a cluster, now can be created by Magnum Kubernetes and Swarm Bay, namely Kubernetes and Swarm clusters.
Baymodel: Baymodel is an extension of Flavor, the Flavor is mainly defined the specifications of the virtual machine or physical machine, Baymodel mainly define a Docker cluster some specifications, such as the cluster management node Flavor, Flavor of computing nodes, cluster USES Image and so on, can be defined through Baymodel.
A Node in the Node: mainly refers to the Bay.
A Docker Container Container: be specific.
Pod, the Replication of the Controller and the Service and the meaning of the three concepts, their meaning is the same in Kubernetes, here a brief introduction is as follows.
Pod is the most basic deployment scheduling unit Kubernetes, can contain more than one Container, logically said some applications of an instance.Such as a web site used by the front-end and back-end and is constructed from the database, the three components will run in separate containers, so we can create three Pod, each Pod run a service.Or three services can be created in a Pod, depending on the application requirements of users.A Pod will contain n + 1 Container, more out of a Container that is Net Container, specially do routing.
Service: can be understood as a route of Pod, Pod in operation may be deleted or IP changes, the Service can guarantee the dynamic changes of Pod access side is transparent.
Replication Controller: is the Pod copy abstraction, used to solve the problem of expansion shrinkage capacity of Pod.Usually, distributed applications for performance and high availability, need more copies of resources, and according to the load dynamic scaling.Through Replication Controller, the user can specify an application needs a few copy, Kubernetes copies for each create a Pod, number of Pod and ensure that the actual operation always is in keeping with a predefined number of (for example, the current a Pod is down, automatically create new Pod to replace).
Magnum main function
Figure 3 Magnum main function
Figure 3 shows the main functions of the Magnum.
Users by Magnum CLI calls Magnum API to create Bay, to meet the needs of users can set the number of nodes the current Bay in the CLI, create Bay use Baymodel, and so on.Magnum mainly is to use it to create Bay, the function of the Heat each Bay is a it Heat Stack.
Users can invoke the Magnum API to adjust the current Bay number of nodes, can for the current Bay dynamically add and remove nodes.Expansion and contraction Bay mainly is to use the it Stack the Update function of the Heat.
Manage the Container by Swarm
Users can Magnum API and the background of Swarm Bay to interaction management (create, delete, change, query) DockerContainer.Magnum is the creation of the container is not scheduling, but after and Swarm integration, can use the scheduling mechanism of Swarm to help Magnum to realize the function of the resource scheduling of container.Because Magnum support multi-tenancy, each tenant can create your own Swarm Bay (cluster), so when the user through the Swarm to create a Container, you need to specify the current user need Swarm Bay, in the specified Swarm Bay to create a Container.
Manage the Container by Kubernetes
Users can interact and Kubernetes by Magnum API, to help users to manage (create, delete, change, query) Kubernetes objects, including Pod, Service, and the Replication of the Controller.Magnum is mainly through its API will Kubernetes API for a layer of encapsulation, allows users to directly by Magnum and back-end Kubernetes interaction.When Kubernetes Bay has been created, the user can also through the Endpoint Magnum view Kubernetes, if the user can get the Endpoint of Kubernetes, can directly by Kubernetes API and back-end Kubernetes to interact.Can see Magnum provides two methods to and back-end Kubernetes interaction, by Magnum packaging API or directly by Kubernetes API.
Now it Dev List in discussing a problem: now that allows users to directly through Kubernetes API to interact with the background of Kubernetes cluster to, why should a layer of encapsulated by Magnum do?It is suggested that Magnum abandoned on Kubernetes Pod, the Service and the Replication of Controller API, Magnum as a COED - as - a - Service tools (COED: Container Orchestration Engine Deployment).This topic will be discussed it in Tokyo for the summit, the author's view is Magnum focuses on container services, if only
focus in COED, Magnum became another Puppet/Chef/Ansible, this and the design of the Magnum is a departure from the original.
The ideal Magnum is supposed to be another "Nova", but this "Nova" focus on container services.Real Nova API is very simple, because whether the KVM, the Hyper - V or VMware, their exposure to the outside objects are VM, so in Nova API mainly provides some operations of VM (Nova also added support for Ironic, this temporary skip).But for Docker COE, since different COE management tools for the Docker Container to do the packaging, such as Kubernetes have Pod, Service, and Replication Controller, Swarm only Docker Container, this leads to a Magnum API is difficult on the background of different COE Container object abstraction, which have a lot of work to do.
Magnum in L version of the new features
Integrated with Mesos
In the Liberty, Magnum introduced a new Bay: Mesos Bay.Mesos Bay and other Bay is the same, is made up of Nova instance.
Mesos Bay architecture
Because Mesos need to rely on the upper Framework provide container service to the outside world, the Marathon is a popular distributed init services, so the Magnum in L version of Mesos Bay mainly include Mesos and Marathon, the future is likely to run on Mesos other Framework.Mesos for resource management, the function of task execution, Mesos allows users to all tasks in the Docker Container operation;Marathon is mainly to do service management.Users can through the Marathon use Mesos services running in the Docker Container.
Figure 4 Mesos Bay architecture
The working process of the Mesos Bay
S create a Baymodel Mesos
Create a Mesos Baymodel, set the Baymodel COE to Mesos.
Create a Mesos Baymodel figure 5
S create a Mesos Bay
Create a two node through the above create Baymodel MesosBay, when Mesos Bay has
been created, will contain Mesos and Marathon at the same time.
Figure 6 to create a Mesos Bay
S get Mesos Bay of the Endpoint
When Mesos Bay has been created, the user can get Mesos through "Magnumbay - show" the detailed information of the Bay Mesos Bay api_address says Marathon in details the Endpoint of the Web UI.Users can access the Marathon to create through the IP service.
Figure 7 through "Magnum bay - show" get Mesos bay details
S access Marathon Web UI
Mesos Bay has been created, the user can through the Mesos Bay api_address to visit the Marathon in the Web UI, through MarathonWeb UI to write the application of the template, will run their applications in the Docker Container.
Figure 8 access Marathon Web UI
Kubernetes high availability function
S Kubernetes high availability
Kuber netes in 1.0 added support for HA, but now Kubernetes HA solution is not very mature, Kubernetes official don't should be used in a production environment.Is shown in figure 9 Kubernetes HA architecture diagram, Kubernetes HA is mainly using etcd master election, an API from more than one master server and ensure that at least one master is available, to achieve high availability.Foreign to the Load Balancer provide entrance way.There are the following points need to pay attention to:
1. The current mode of HA scheme using different processing read and write operations.
2. To read operation, HA cluster will have multiple apiserver Kubernetes, the Load Balancer will forward the user's request to the corresponding API server.
3. To write operation, because every time only allow a master to interact with the etcd, so you need to choose through etcd a master, only the master can with scheduler and controller manager to interact, modify the state of the etcd.In each of the API server nodes, run a podmaster.Podmaster's main function is to use etcd election master "compare and swap" mechanism, if an API server node is selected, the API server will start the scheduler and the controller of the current node manager;If the election fails, the API server needs to be a scheduler and controller of the current node manager stopped.Kubernetes community are planning to do the function of HA some improvements, such as the introduction of Active - Active master mode.Specific can consult
Figure 9 Kubernetes HA architecture diagram
S Magnum Kubernetes Bay HA profile
Figure 10 is Magnum Kubernetes Bay of HA solution, you can see the Magnum Kubernetes Bay HA is mainly using the Neutron Load Balancer Kubernetes HA scheme to realize the LoadBalancer, other logic are using Kubernetes itself functions.Magnum CLI and client Kubernetes is by Neutron Load Balancer and back-end Kubernetes Bay interaction.
Figure 10 Magnum Kubernetes Bay HA scheme
S create Kubernetes create Kubernetes HA HA Bay Bay and create ordinary Kubernetes Bay is the only difference in creating HA Bay, you need to create more than one master node, and contains at least three master node, and only in this way can guarantee the normal work of the etcd can.
Figure 11 create Kubernetes HA Bay
Intelligent contraction Magnum support dynamic adjustment Bay Bay node number of nodes.Users only need to pass the Magnum bay - update "can update node number, you can delete or add node.But when a node is removed, it may delete some Container at runtime node, affect customer's homework, so the Magnum in L version introduces the function of intelligent contraction Bay node.When the user want to delete some of the Bay of nodes, the