Skip to content

Commit

Permalink
Document pod-template-hash label
Browse files Browse the repository at this point in the history
Signed-off-by: Michail Kargakis <mkargaki@redhat.com>
  • Loading branch information
0xmichalis authored and chenopis committed Jun 26, 2017
1 parent 25b8f9a commit 8c41480
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions docs/concepts/workloads/controllers/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,22 @@ nginx-deployment-2035384211-qqcnn 1/1 Running 0 18s app

The created ReplicaSet will ensure that there are three nginx Pods at all times.

**Note:** You must specify appropriate selector and pod template labels of a Deployment (in this case,
`app = nginx`), i.e. don't overlap with other controllers (including Deployments, ReplicaSets,
ReplicationControllers, etc.) Kubernetes won't stop you from doing that, and if you end up with multiple
controllers that have overlapping selectors, those controllers will fight with each other and won't behave
**Note:** You must specify an appropriate selector and pod template labels in a Deployment (in this case,
`app = nginx`), i.e. don't overlap with other controllers (including other Deployments, ReplicaSets,
StatefulSets, etc.). Kubernetes won't stop you from doing that, and if you end up with multiple
controllers that have overlapping selectors, those controllers may fight with each other and won't behave
correctly.

### Pod-template-hash label

**Note:** This label is not meant to be mutated by users!

Note the pod-template-hash label in the example output in the pod labels above. pod-template-hash is added by the
Deployment controller in every ReplicaSet that a Deployment creates or adopts. Its purpose is so that children
ReplicaSets of a Deployment will not overlap among them. It is computed by hashing the PodTemplate of the ReplicaSet
and using the resulting hash as the label value that will be added in the ReplicaSet selector, pod template labels,
and in any existing Pods that the ReplicaSet may have.

## Updating a Deployment

**Note:** a Deployment's rollout is triggered if and only if the Deployment's pod template (i.e. `.spec.template`)
Expand Down

0 comments on commit 8c41480

Please sign in to comment.