Skip to content

Instantly share code, notes, and snippets.

@rabellamy
Last active October 12, 2018 18:49
Show Gist options
  • Save rabellamy/28ed4c2c71e89bda9863d1ed5f67ce8b to your computer and use it in GitHub Desktop.
Save rabellamy/28ed4c2c71e89bda9863d1ed5f67ce8b to your computer and use it in GitHub Desktop.

ReplicaSets

A ReplicaSet behaves exactly like a ReplicationController, but it has more expressive pod selectors. Whereas a ReplicationController’s label selector only allows matching pods that include a certain label, a ReplicaSet’s selector also allows matching pods that lack a certain label or pods that include a certain label key, regardless of its value.

Also, for example, a single ReplicationController can’t match pods with the label env=production and those with the label env=devel at the same time. It can only match either pods with the env=production label or pods with the env=devel label. But a single ReplicaSet can match both sets of pods and treat them as a single group.

Similarly, a ReplicationController can’t match pods based merely on the presence of a label key, regardless of its value, whereas a ReplicaSet can. For example, a ReplicaSet can match all pods that include a label with the key env, whatever its actual value is (you can think of it as env=*).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment