Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Open container cluster management system architecture and components introduced Kubernetes     - Python objects (Programming)

- Memcached distributed caching (Server)

- W and uptime command (Linux)

- Install Xshell on Mac OS X (Linux)

- Spring classic face questions Share (Programming)

- Detailed Linux platform chip programming process (Programming)

- STL in the list of erase () method (Programming)

- Running the open-source Swift under Linux platform (Linux)

- Linux atomic operations and synchronization mechanisms (Programming)

- Actual custom yum repository ---- gem commands commonly used parameters (Linux)

- Python context managers (Programming)

- Oracle large table to clean truncate .. reuse storage (Database)

- File sharing and fork function (Programming)

- Nodejs complete installation instructions for Express (Linux)

- MySQL Online DDL tools of pt-online-schema-change (Database)

- Linux filtration empty file command summary (Linux)

- Linux Shell Scripting Interview Question (Linux)

- To restore the last time applications running when Ubuntu user log in again (Linux)

- Oracle 12c R2 new feature dbca command to create a standby database (Database)

- The development environment to build Nodejs under Ubuntu 14.04 (Linux)

 
         
  Open container cluster management system architecture and components introduced Kubernetes
     
  Add Date : 2016-11-17      
         
       
         
  This article comes from Infoq article (see reference section), and on the basis of hard to understand their own understanding of the modifications made. Actual deployment kubernetes operating See article on Ubuntu.

Together we will ensure that Kubernetes is a strong and open container management framework for any application and in any environment, whether in a private, public or hybrid cloud. --Urs Hölzle, Google

Kubernetes Docker ecosystem as an important one, is the open source version of Google many years of large-scale container management technology, the best performance of the production line of practical experience. As Urs Hölzle said, whether it is public or private clouds or hybrid cloud, Kubernetes any application as a container management framework in any environment everywhere. Because of this, currently subject to major giants and startups of all ages, such as Microsoft, VMWare, Red Hat, CoreOS, Mesos, etc., have joined to Kubernetes contribute code. With Kubernetes community and major manufacturers continue to improve, develop, Kuberentes will become a leader in container management.

Next we explore together what Kubernetes that can do and how to do it.

1. What is Kubernetes

Kubernetes Google is open source cluster management system container, use Golang development, which provide application deployment, maintenance, and other functions extension mechanism using Kubernetes can easily manage cross-machine operation of the container application, its main function is as follows:

Use Docker application package (package), instantiate (instantiate), run (run).
In a cluster running the way cross-machine containers.
Docker solve communication problems between the cross-machine container.
Self-repair mechanism Kubernetes makes container cluster always run in the user's desired state.
Current Kubernetes support GCE, vShpere, CoreOS, OpenShift, Azure and other platforms, in addition, can also be run directly on a physical machine.

The main concepts 2. Kubernetes

2.1 Pods

In Kubernetes system, the smallest particles of scheduling is not a simple container, but abstracted into a Pod, Pod is a can be created, destroyed, scheduling, management smallest deployment unit. To a related or more containers (Container) constitute a Pod, Pod same applications typically run in a container. Container runs Pod contained in the same Minion (Host) on, as a unified management unit volumes and share the same network namespace / IP and Port space.

2.2 Services

Services also Kubernetes basic operating unit is an abstract real-world applications and services, each service has a lot of behind the corresponding container to support, to provide back-end services through the port and Proxy service selector determines the service request delivery container, external performance a single access address, external not need to know how to run the back-end, which extend to the rear end or maintenance bring great benefits.

This document services.md official website on github speak particularly clear.

2.3 Replication Controllers

Replication Controller, understood as a more complex form of pods, which ensures that any time there is a cluster Kubernetes pod specified number of copies (replicas) in operation, if less than the specified number of pod copies (replicas), Replication Controller starts a new Container, On the other hand it will kill the excess amount in order to ensure the same. Replication Controller using pre-defined templates to create pod pods, once created successfully, pod pods create templates and no association can be modified without affecting the template has been created pod pods have any effect, you can directly update pods created by Replication Controller . For use pods pod created from a template, Replication Controller label selector according to the association, by modifying the pods of the label you can delete the corresponding pods. Replication Controller has the following usage:

Rescheduling
As described above, Replication Controller will ensure that the cluster Kubernetes specified pod copies (replicas) in operation, even if the node was an error.

Scaling
By modifying a copy of Replication Controller (replicas) the number of pods to extend or reduce the level of operation.

Rolling updates
Replication Controller design principle makes it possible to replace the pods one by one to rollover (rolling updates) service.

Multiple release tracks
If you need to run multiple release of the service in the system, Replication Controller use labels to distinguish between multiple release tracks.

These three concepts of REST is a user-operable object. Kubernetes open to form RESTfull API interface to deal with.

2.4 Labels

service and replicationController only on a pod of abstraction, ultimately to act on the pod, then how do they link with pod? This introduces the concept of the label: label is actually very good understanding, it is to be used to search for or pod plus a set of associated key / value labels, and it is through service and replicationController label to associate with the pod. In order to access the plurality of containers Service forwards the request to the back-end service, it is identified by the container labels to select the correct container; Replication Controller also use labels to manage a set of containers through the pod to create a template, so you can Replication Controller more easily and conveniently manage multiple containers.

You can specify the following figure, there are three pod has a label as "app = backend", to create a service and replicationController when the same label: "app = backend", and then through the label selector mechanism, they will be associated with these three pod Woke up. For example, when there are other frontend pod when accessing the service, which is automatically forwarded to a backend pod.

3. Kubernetes member

Kubenetes overall framework as follows, including kubecfg, Master API Server, Kubelet, Minion (Host) and Proxy.

3.1 Master

Master define the main statement Kubernetes Cluster Master / API Server, including Pod Registry, Controller Registry, Service Registry, Endpoint Registry, Minion Registry, Binding Registry, RESTStorage and Client, a client (Kubecfg) call Kubernetes API, management Kubernetes main member Pods , Services, Minions, an inlet of the container. Master by the API Server, Scheduler and Registry and other components. From the figure we can see Master workflow mainly consists of the following steps:

Kubecfg specific requests, such as creating Pod, sent to Kubernetes Client.
Kubernetes Client sends a request to the API server.
When the API Server based on the type of request, such as creating Pod storage type pods, and so the choice of REST Storage API to process the request.
REST Storage API to request for the corresponding treatment.
The result of the process is stored in a highly available key-value storage system Etcd.
After the API Server response Kubecfg request, Scheduler will get the cluster running Pod and Minion information based Kubernetes Client.
Based on information obtained from Kubernetes Client, Scheduler will undistributed Pod distributed to Minion node available.

The following is a detailed description of the main components of the Master.

3.1.1 Minion Registry

Minion Registry is responsible for tracking the number of cluster Kubernetes Minion (Host). Kubernetes package Minion Registry to implement RESTful API interfaces REST Kubernetes API Server through the API, we can do Minion Registry Create, Get, List, Delete operation, as Minon can only be created or deleted, it does not support the Update operation, and Minion of the stored configuration information to etcd. In addition, Scheduler algorithm based on the Minion resource capacity to determine whether the new Pod Minion distributed to the node.

You can curl http: // {master-apiserver-ip}: 4001 / v2 / keys / registry / minions / etcd to verify the contents of the store.

3.1.2 Pod Registry

Pod Registry is responsible for tracking how many Pod Kubernetes cluster is running, and how these Pod with Minion mapping. The package Pod Registry and Cloud Provider information and other relevant information to implement RESTful API interfaces REST Kubernetes API Server of. Through these API, we can be Pod Create, Get, List, Update, Delete operations, and information stored in the Pod in etcd, but also by changes in the interface monitoring Pod Watch, for example, a Pod is new, delete or update .

3.1.3 Service Registry

Service Registry is responsible for tracking all services running Kubernetes cluster. According Cloud Provider offers and Minion Registry information package to implement the Service Registry Kubernetes API Server needs RESTful API interfaces REST. Using these interfaces, we can be of Service Create, Get, List, Update, Delete operations, as well as watch Operations Monitoring Service to changing circumstances, and the information stored in Service to etcd.

3.1.4 Controller Registry

Controller Registry is responsible for tracking all Kubernetes cluster Replication Controller, Replication Controller pod maintains a specified number of copies (replicas) copy, if one of them died container, Replication Controller automatically starts a new container, if the dead container recovery which will kill more of the container to ensure that the specified copy unchanged. By encapsulating Controller Registry to implement RESTful API interfaces REST Kubernetes API Server, the use of these interfaces, we can Replication Controller carried Create, Get, List, Update, Delete operations, as well as monitor the Replication Controller changes the watch operation, and the Replication Controller information stored etcd.

3.1.5 Endpoints Registry

Endpoints Registry Service is responsible for collecting the endpoint, such as Name: "mysql", Endpoints: [ "10.10.1.1:1909","10.10.2.2:8834"], with Pod Registry, Controller Registry also achieved a RESTful API Kubernetes API Server interface, you can do Create, Get, List, Update, Delete and watch operations.

3.1.6 Binding Registry

Binding includes a need to bind ID and Pod Pod bound Host, Scheduler write Binding Registry, required binding Pod is bound to a host. Binding Registry also implements the RESTful API interfaces Kubernetes API Server, but Binding Registry is a write-only object, all only Create operations can be used, otherwise it will cause an error.

3.1.7 Scheduler

Scheduler collection and analysis of all cluster resources currently Kubernetes Minion nodes (memory, CPU) load, and so distribute the new Pod to Kubernetes cluster nodes available. Once Minion due to resource nodes are allocated to the Pod, those resources can not be reallocated to other Pod, Pod unless they are deleted or exit, therefore, Kubernetes need to analyze all the Minion cluster resource usage to ensure that the distribution of the workload will not the Minion node beyond the current scope of available resources. Specifically, Scheduler do the following:

Real-time monitoring Kubernetes cluster undistributed Pod.
Real-time monitoring Kubernetes cluster all running Pod, Scheduler Pod these resources need to safely distribute the Pod will not be distributed to the specified node Minion.
Scheduler also monitored Minion node information, due to frequent Find Minion node, Scheduler cached copy of the latest information locally.
Finally, Scheduler Pod after distribution to the specified node Minion, Pod will write back information related to Binding API Server.
3.2 Kubelet

Kubelet connection points Kubernetes cluster and each Minion Master API Server, and Kubelet run on each Minion, is a bridge between the Master API Server and Minion, receiving, Master API Server commands assigned to it and work, and persistence key-value store etcd, file, server and http interact read configuration information. Kubelet main job is to manage the life cycle of container and Pod, including Docker Client, Root Directory, Pod Workers, Etcd Client, Cadvisor Client and Health Checker assembly works are as follows:

Action to run a specific asynchronous Pod by Worker
Setting container environment variables
Binding to the container Volume
Binding Port for container
Pod according to the specified run a single container
Killed container
Pod to create a network to the specified container
Remove all containers Pod
Pod synchronization status
Get container info, pod info, root info, machine info from cAdvisor
Detection Pod vessel health information
Run command in the container.
3.3 Proxy

Proxy to solve the external network to access applications and services across the cluster machine provided by the container and designed to run on each Minion. Proxy provides TCP / UDP sockets of proxy, each creation of a Service, Proxy Services and Endpoints mainly get configuration information (also available from file) from etcd, then start the process of a Proxy configuration information in accordance with and monitor the corresponding Minion service port, when the external request occurs, Proxy based Load Balancer will distribute requests to the correct back-end processing of container.

So Proxy service port not only solve the same problem in the same conflict of primary residential unit also provides the ability to Service port forwarding service external service provider, Proxy backend uses a random, round robin load balancing algorithm. For more kube-proxy content KUBERNETES code for commuting the MINION NODE component KUBE-PROXY.

4. etcd

etcd on the chart above mentioned several times, but it is not part of kubernetes, which is a management team initiated CoreOS configuration and service discovery (service discovery) project goal is to build a highly available distributed key (key-value) database. Kubernetes and docker or with the same products in the fast iterative development, and not as mature ZooKeeper. Also we have the opportunity to introduce through articles.
     
         
       
         
  More:      
 
- Oracle capability i / o (stress test database server i / o performance) (Database)
- Linux initialization init systems - Systemd (Linux)
- CKEditor + SWFUpload achieve a more powerful editor (Linux)
- Install the latest development version of Wine on RedHat and Debian-based systems (Linux)
- To install MySQL 5.6 binary packages under CentOS 6.4 64bit (Database)
- Advanced Linux security settings (Linux)
- How to install Unbound and DNSCrypt in Archlinux (Server)
- Python type way of comparison (Programming)
- Summarize small problems encountered in the use Lua (Programming)
- Linux screen commonly commands (Linux)
- Linux C source code (Ascii HexToBinary: Converts hexadecimal string format ASCII codes) (Programming)
- Restore database fault encountered ORA-0600 (Database)
- Linux system performance and usage activity monitoring tools -Sysstat (Linux)
- Linux Routine Task Scheduler (Linux)
- Nginx version of helloworld (Server)
- How to install Linux Kernel 4.0 On CentOS 7 system (Linux)
- Snapshot DataGuard (Database)
- Oracle 12c detailing the new features (Database)
- CentOS7 compile and install Tengine + PHP + MariaDB notes (Server)
- Java NIO2: Buffer (Programming)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.