Skip to content

Commit e124688

Browse files
oculushutTim Bannistertengqm
authored
Clearer information about the emptyDir and correction for how topologyKey works (#42780)
* removes "tmpfs is cleared on node reboot" I believe the statement is confusing since we are in the emptyDir section of the documentation. If a Node is restarted then all pods that resided on that node will be rescheduled onto another Node. Rescheduled pods will have an empty volume whether you choose emptyDir.medium "Memory" or not. * removes bad comma * improves memory limit description Co-authored-by: Tim Bannister <[email protected]> * removes incorrect explanation for topologyKey in an affinity or anti-affinity rule (#1) The existing text does not make sense to me. There is no zone "V" or "R" in the example. I have changed the text to be consistent with top answer here which seems to make more sense: https://stackoverflow.com/questions/72240224/what-is-topologykey-in-pod-affinity * gives more context to node label configuration * manually wraps text and replaces absolute links with relative ones * Update assign-pod-node.md --------- Co-authored-by: Tim Bannister <[email protected]> Co-authored-by: Qiming Teng <[email protected]>
1 parent e4a2ab2 commit e124688

File tree

2 files changed

+25
-17
lines changed

2 files changed

+25
-17
lines changed

content/en/docs/concepts/scheduling-eviction/assign-pod-node.md

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ specific Pods:
3535
## Node labels {#built-in-node-labels}
3636

3737
Like many other Kubernetes objects, nodes have
38-
[labels](/docs/concepts/overview/working-with-objects/labels/). You can [attach labels manually](/docs/tasks/configure-pod-container/assign-pods-nodes/#add-a-label-to-a-node).
39-
Kubernetes also populates a [standard set of labels](/docs/reference/node/node-labels/) on all nodes in a cluster.
38+
[labels](/docs/concepts/overview/working-with-objects/labels/). You can
39+
[attach labels manually](/docs/tasks/configure-pod-container/assign-pods-nodes/#add-a-label-to-a-node).
40+
Kubernetes also populates a [standard set of labels](/docs/reference/node/node-labels/)
41+
on all nodes in a cluster.
4042

4143
{{<note>}}
4244
The value of these labels is cloud provider specific and is not guaranteed to be reliable.
@@ -303,17 +305,23 @@ Pod affinity rule uses the "hard"
303305
`requiredDuringSchedulingIgnoredDuringExecution`, while the anti-affinity rule
304306
uses the "soft" `preferredDuringSchedulingIgnoredDuringExecution`.
305307

306-
The affinity rule says that the scheduler can only schedule a Pod onto a node if
307-
the node is in the same zone as one or more existing Pods with the label
308-
`security=S1`. More precisely, the scheduler must place the Pod on a node that has the
309-
`topology.kubernetes.io/zone=V` label, as long as there is at least one node in
310-
that zone that currently has one or more Pods with the Pod label `security=S1`.
311-
312-
The anti-affinity rule says that the scheduler should try to avoid scheduling
313-
the Pod onto a node that is in the same zone as one or more Pods with the label
314-
`security=S2`. More precisely, the scheduler should try to avoid placing the Pod on a node that has the
315-
`topology.kubernetes.io/zone=R` label if there are other nodes in the
316-
same zone currently running Pods with the `Security=S2` Pod label.
308+
The affinity rule specifies that the scheduler is allowed to place the example Pod
309+
on a node only if that node belongs to a specific [zone](/docs/concepts/scheduling-eviction/topology-spread-constraints/topology-spread-constraints/)
310+
where other Pods have been labeled with `security=S1`.
311+
For instance, if we have a cluster with a designated zone, let's call it "Zone V,"
312+
consisting of nodes labeled with `topology.kubernetes.io/zone=V`, the scheduler can
313+
assign the Pod to any node within Zone V, as long as there is at least one Pod within
314+
Zone V already labeled with `security=S1`. Conversely, if there are no Pods with `security=S1`
315+
labels in Zone V, the scheduler will not assign the example Pod to any node in that zone.
316+
317+
The anti-affinity rule specifies that the scheduler should try to avoid scheduling the Pod
318+
on a node if that node belongs to a specific [zone](/docs/concepts/scheduling-eviction/topology-spread-constraints/topology-spread-constraints/)
319+
where other Pods have been labeled with `security=S2`.
320+
For instance, if we have a cluster with a designated zone, let's call it "Zone R,"
321+
consisting of nodes labeled with `topology.kubernetes.io/zone=R`, the scheduler should avoid
322+
assigning the Pod to any node within Zone R, as long as there is at least one Pod within
323+
Zone R already labeled with `security=S2`. Conversely, the anti-affinity rule does not impact
324+
scheduling into Zone R if there are no Pods with `security=S2` labels.
317325

318326
To get yourself more familiar with the examples of Pod affinity and anti-affinity,
319327
refer to the [design proposal](https://git.k8s.io/design-proposals-archive/scheduling/podaffinity.md).
@@ -327,7 +335,8 @@ to learn more about how these work.
327335
In principle, the `topologyKey` can be any allowed label key with the following
328336
exceptions for performance and security reasons:
329337

330-
- For Pod affinity and anti-affinity, an empty `topologyKey` field is not allowed in both `requiredDuringSchedulingIgnoredDuringExecution`
338+
- For Pod affinity and anti-affinity, an empty `topologyKey` field is not allowed in both
339+
`requiredDuringSchedulingIgnoredDuringExecution`
331340
and `preferredDuringSchedulingIgnoredDuringExecution`.
332341
- For `requiredDuringSchedulingIgnoredDuringExecution` Pod anti-affinity rules,
333342
the admission controller `LimitPodHardAntiAffinityTopology` limits

content/en/docs/concepts/storage/volumes.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,8 @@ The `emptyDir.medium` field controls where `emptyDir` volumes are stored. By
245245
default `emptyDir` volumes are stored on whatever medium that backs the node
246246
such as disk, SSD, or network storage, depending on your environment. If you set
247247
the `emptyDir.medium` field to `"Memory"`, Kubernetes mounts a tmpfs (RAM-backed
248-
filesystem) for you instead. While tmpfs is very fast, be aware that unlike
249-
disks, tmpfs is cleared on node reboot and any files you write count against
250-
your container's memory limit.
248+
filesystem) for you instead. While tmpfs is very fast be aware that, unlike
249+
disks, files you write count against the memory limit of the container that wrote them.
251250

252251

253252
A size limit can be specified for the default medium, which limits the capacity

0 commit comments

Comments
 (0)