Skip to content

Commit 5df0293

Browse files
authored
Merge pull request #53111 from andrewsykim/pod-topology-labels-1-35
add docs for PodTopologyLabelsAdmission feature
2 parents 60cb290 + 5f2da47 commit 5df0293

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-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="PodTopologyLabelsAdmission" >}}
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.

content/en/docs/reference/command-line-tools-reference/feature-gates/PodTopologyLabelsAdmission.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ stages:
99
- stage: alpha
1010
defaultValue: false
1111
fromVersion: "1.33"
12+
toVersion: "1.34"
13+
- stage: beta
14+
defaultValue: true
15+
fromVersion: "1.35"
1216
---
1317
Enables the `PodTopologyLabels` admission plugin.
1418
See [Pod Topology Labels](docs/reference/access-authn-authz/admission-controllers#podtopologylabels)

0 commit comments

Comments
 (0)