[05] Kubernets: resource inventory (controllers)

EDITORIAL words

 

From the beginning of the previous section, we have been learning about the list of written resources Autonomous Pod, Pod autonomous but there is a problem, that is, and we directly run docker docker run the same container. If we want to form a cluster and with complex processing logic is not so easy to use.

On this point, we will deal with the Pod to the controller.

 

 

About Controller

 

Before then explain in detail how to use the controller, the controller is what we need to know, and what we need.

When Master explain the composition of the K8S said, Master node there is an important component called the Controller Manager.

Controller Manager of kube-controller-manager and cloud-controller-manager composition, is at the heart of K8S.

Cloud controller general re-use in the cloud with the service, so we are not too concerned about the focus.

kube-controller-manager controller the following main components:

1. Replication Controller (abandoned)

2. Replicaset

3. Deployment Controller

4. DaemonSet Controller

5. Job / CronJob Controller

6. Volume Controller

7. StatefulSet Controller

8. Node Controller

9. Service Controller

10. and so on ...

 

 

Common Controller Description

 

Replication Controller:

To ensure that the number of copies running within a specific time, Duotuishaobu. And not to be concerned with the state of the pod, as long as you are deleted or terminated automatically replace you. He's like a process manager oversees pod multiple nodes. 

The controller is configured as the default only restartPolicy Always take effect, and the controller will never turn itself off. But we want the controller is accompanied by life-cycle services to create deletion, because the program will be updated.

 

ReplicaSet:

A copy of the new generation of controllers, belonging to the Replication Controller upgraded version, except that the new version supports more advanced selector.

 

Deployment:

Scheduling ReplicaSet achieve our demands, the government has also suggested that we use the Deployment alternative ReplicaSet. E.g:

Use Deployment to create ReplicaSet, ReplicaSet will start the related Pod in the background and detect its status.

When we update the Pod Deployment status defined, it will be based on the new ReplicaSet and policy configuration, so ReplicaSet according to certain rules to rebuild Pod, to achieve switching.

 

StatefulSet:

Mainly used to solve the problem of stateful services. Later it will specifically be used.

 

DaemonSet:

Guarantee has run one copy on each node, used as the cluster log collection and monitoring.

 

Guess you like

Origin www.cnblogs.com/Dy1an/p/10950058.html