Skip to content

Commit 4233c52

Browse files
authored
Merge pull request #42051 from sybereal/fix-crossnamespacepodaffinity
Fix example errors for CrossNamespacePodAffinity
2 parents 329af06 + cfb6309 commit 4233c52

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

content/en/docs/concepts/policy/resource-quotas.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ from getting scheduled in a failure domain.
465465
466466
Using this scope operators can prevent certain namespaces (`foo-ns` in the example below)
467467
from having pods that use cross-namespace pod affinity by creating a resource quota object in
468-
that namespace with `CrossNamespaceAffinity` scope and hard limit of 0:
468+
that namespace with `CrossNamespacePodAffinity` scope and hard limit of 0:
469469
470470
```yaml
471471
apiVersion: v1
@@ -478,11 +478,12 @@ spec:
478478
pods: "0"
479479
scopeSelector:
480480
matchExpressions:
481-
- scopeName: CrossNamespaceAffinity
481+
- scopeName: CrossNamespacePodAffinity
482+
operator: Exists
482483
```
483484

484485
If operators want to disallow using `namespaces` and `namespaceSelector` by default, and
485-
only allow it for specific namespaces, they could configure `CrossNamespaceAffinity`
486+
only allow it for specific namespaces, they could configure `CrossNamespacePodAffinity`
486487
as a limited resource by setting the kube-apiserver flag --admission-control-config-file
487488
to the path of the following configuration file:
488489

@@ -497,12 +498,13 @@ plugins:
497498
limitedResources:
498499
- resource: pods
499500
matchScopes:
500-
- scopeName: CrossNamespaceAffinity
501+
- scopeName: CrossNamespacePodAffinity
502+
operator: Exists
501503
```
502504
503505
With the above configuration, pods can use `namespaces` and `namespaceSelector` in pod affinity only
504506
if the namespace where they are created have a resource quota object with
505-
`CrossNamespaceAffinity` scope and a hard limit greater than or equal to the number of pods using those fields.
507+
`CrossNamespacePodAffinity` scope and a hard limit greater than or equal to the number of pods using those fields.
506508

507509
## Requests compared to Limits {#requests-vs-limits}
508510

0 commit comments

Comments
 (0)