Kubernetes 之 Replica Set

Because Replication Controller and Kubernetes code module Replication Controller of the same name, but the word can not be expressed exactly what it means, so start from Kubernetes v1.2, it escalated into another new object --Replica Set, the official explanation for the "the next generation of Replication Controller". The only difference between it and Replication Controller currently exists is: Replica Set Support Label selector (Set-based selector) set-based, and Replication Controller supports only equation-based Label selector (equality-based selector), so Replica Set function more powerful. Here is the definition of an example of Replica Set (omitted portion of the template content Pod):

apiVeReplica Setion: extensions/v1beta1
kind: ReplicaSet
metadata:
  name: frontend
spec:
  selector:
    matchLabels:
      tier: frontend
    matchExpressions:
      - {key: tier, operator: In, values: [frontend]}
  template:

Replica Set rarely used alone, it is mainly Deployment of this higher-level resource object used to form a set of Pod to create, delete, update the layout mechanism.
Characteristics and role Replication Controller and Replica Set as follows:

    • In most cases, we define a Replication Controller achieved through the creation of automatic control and the number of copies of the Pod.
    • Replication Controller in Pod includes a complete custom template.
    • Replication Controller for automatic control of the Pod copy by Label Selector mechanism.
    • By changing the Replication Controller Pod in copy number, or may be implemented Pod expansion volume reduction function.
    • By changing the mirrored version of Replication Controller in Pod template can be achieved Pod rolling upgrades.

Guess you like

Origin www.cnblogs.com/peteremperor/p/12533263.html