Skip to content

Commit 43271a8

Browse files
committed
add docs for PodTopologyLabelsAdmission feature
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
1 parent 6e84135 commit 43271a8

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,34 @@ overall utilization.
675675
Read [Pod topology spread constraints](/docs/concepts/scheduling-eviction/topology-spread-constraints/)
676676
to learn more about how these work.
677677

678+
## Pod topology labels
679+
680+
{{< feature-state feature_gate_name="PodTopologyLabelAdmission" >}}
681+
682+
Pods inherit the topology labels (topology.kubernetes.io/zone and topology.kubernetes.io/region) from their assigned Node if those labels are present. These labels can then be utilized via the Downward API to provide the workload with node topology awareness.
683+
684+
Here is an example of a Pod using downward API for it's zone and region:
685+
```yaml
686+
apiVersion: v1
687+
kind: Pod
688+
metadata:
689+
name: pod-with-topology-labels
690+
spec:
691+
containers:
692+
- name: app
693+
image: alpine
694+
command: ["sh", "-c", "env"]
695+
env:
696+
- name: MY_ZONE
697+
valueFrom:
698+
fieldRef:
699+
fieldPath: metadata.labels['topology.kubernetes.io/zone']
700+
- name: MY_REGION
701+
valueFrom:
702+
fieldRef:
703+
fieldPath: metadata.labels['topology.kubernetes.io/region']
704+
```
705+
678706
## Operators
679707

680708
The following are all the logical operators that you can use in the `operator` field for `nodeAffinity` and `podAffinity` mentioned above.

0 commit comments

Comments
 (0)