From 3ca2b443acff6ff8149b0654b0c75e0ad6f20d22 Mon Sep 17 00:00:00 2001 From: Lawrence Chou Date: Tue, 13 Feb 2024 10:37:33 +0800 Subject: [PATCH] Fix `matchLabelKeys` example yaml syntax It should be `spec.template.spec.affinity` instead of `spec.template.affinity`. ``` $ explain deploy.spec.template.spec.affinity GROUP: apps KIND: Deployment VERSION: v1 FIELD: affinity ... ``` ``` $ k explain deploy.spec.template.affinity GROUP: apps KIND: Deployment VERSION: v1 error: field "affinity" does not exist ``` --- .../scheduling-eviction/assign-pod-node.md | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/content/en/docs/concepts/scheduling-eviction/assign-pod-node.md b/content/en/docs/concepts/scheduling-eviction/assign-pod-node.md index 8aa1e97200..2512c36fc1 100644 --- a/content/en/docs/concepts/scheduling-eviction/assign-pod-node.md +++ b/content/en/docs/concepts/scheduling-eviction/assign-pod-node.md @@ -391,21 +391,22 @@ metadata: ... spec: template: - affinity: - podAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - database - topologyKey: topology.kubernetes.io/zone - # Only Pods from a given rollout are taken into consideration when calculating pod affinity. - # If you update the Deployment, the replacement Pods follow their own affinity rules - # (if there are any defined in the new Pod template) - matchLabelKeys: - - pod-template-hash + spec: + affinity: + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app + operator: In + values: + - database + topologyKey: topology.kubernetes.io/zone + # Only Pods from a given rollout are taken into consideration when calculating pod affinity. + # If you update the Deployment, the replacement Pods follow their own affinity rules + # (if there are any defined in the new Pod template) + matchLabelKeys: + - pod-template-hash ``` #### mismatchLabelKeys