Skip to content

Commit

Permalink
docs: Fix some examples in docs (Azure#650)
Browse files Browse the repository at this point in the history
  • Loading branch information
britaniar authored Jan 3, 2024
1 parent 262ab57 commit 3ac18b5
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 43 deletions.
16 changes: 8 additions & 8 deletions docs/howtos/affinities.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ spec:
placementType: PickAll
affinity:
clusterAffinity:
requiredDuringSchedulingIgnoredDuringExection:
requiredDuringSchedulingIgnoredDuringExecution:
clusterSelectorTerms:
- labelSelector:
matchExpressions:
Expand Down Expand Up @@ -118,14 +118,14 @@ spec:
placementType: PickAll
affinity:
clusterAffinity:
requiredDuringSchedulingIgnoredDuringExection:
requiredDuringSchedulingIgnoredDuringExecution:
clusterSelectorTerms:
- labelSelector:
matchLabels:
region: east
matchExpressions:
- key: system
- operator: Exists
operator: Exists
```

Expand Down Expand Up @@ -159,7 +159,7 @@ spec:
- labelSelector:
matchExpressions:
- key: system
- operator: DoesNotExist
operator: DoesNotExist
```

With these two affinity terms, any cluster picked must:
Expand Down Expand Up @@ -275,10 +275,10 @@ spec:
clusterAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
clusterSelectorTerms:
- labelSelector:
matchExpressions:
- key: system
- operator: Exists
- labelSelector:
matchExpressions:
- key: system
operator: Exists
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 20
preference:
Expand Down
45 changes: 22 additions & 23 deletions docs/howtos/crp.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ kind), and its name, in the resource selector:
```yaml
# As mentioned earlier, all the resources under the namespace will also be selected.
resourceSelectors:
- group: ""
kind: Namespace
version: v1
name: work
- group: ""
kind: Namespace
version: v1
name: work
```

* Alternately, you may also select a set of resources of the same API GVK using a label selector;
Expand All @@ -68,11 +68,11 @@ it also requires that you specify the API GVK and the filtering label(s):
```yaml
# As mentioned earlier, all the resources under the namespaces will also be selected.
resourceSelectors:
- group: ""
kind: Namespace
version: v1
labelSelector:
MatchLabels:
- group: ""
kind: Namespace
version: v1
labelSelector:
matchLabels:
system: critical
```

Expand All @@ -87,9 +87,9 @@ this, use a resource selector with only the API GVK added:

```yaml
resourceSelectors:
- group: "rbac.authorization.k8s.io"
kind: ClusterRole
version: v1
- group: "rbac.authorization.k8s.io"
kind: ClusterRole
version: v1
```

In the example above, all the cluster roles in the hub cluster will be picked.
Expand All @@ -102,12 +102,11 @@ any of the resource selectors specified (i.e., all selectors are OR'd).
```yaml
# As mentioned earlier, all the resources under the namespace will also be selected.
resourceSelectors:
- group: ""
- group: ""
kind: Namespace
version: v1
name: work
resourceSelectors:
- group: "rbac.authorization.k8s.io"
- group: "rbac.authorization.k8s.io"
kind: ClusterRole
version: v1
name: secretReader
Expand Down Expand Up @@ -203,9 +202,9 @@ spec:
clusterAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
clusterSelectorTerms:
- labelSelector:
matchLabels:
system: critical
- labelSelector:
matchLabels:
system: critical
```

The `ClusterResourcePlacement` object above will pick all the clusters with the label
Expand Down Expand Up @@ -260,11 +259,11 @@ spec:
affinity:
clusterAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
weight: 20
preference:
- labelSelector:
matchLabels:
critical-level: 1
- weight: 20
preference:
- labelSelector:
matchLabels:
critical-level: 1
```

The `ClusterResourcePlacement` object above will pick first clusters with the `critical-level=1`
Expand Down
24 changes: 12 additions & 12 deletions docs/howtos/topology-spread-constraints.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ spec:
placementType: PickN
numberOfClusters: 3
topologySpreadConstraints:
- maxSkew: 2
topologyKey: system
whenUnsatisfiable: DoNotSchedule
- maxSkew: 2
topologyKey: system
whenUnsatisfiable: DoNotSchedule
```
## How Fleet enforces topology spread constraints: topology spread scores
Expand Down Expand Up @@ -160,9 +160,9 @@ spec:
placementType: PickN
numberOfClusters: 2
topologySpreadConstraints:
- maxSkew: 1
topologyKey: region
whenUnsatisfiable: DoNotSchedule
- maxSkew: 1
topologyKey: region
whenUnsatisfiable: DoNotSchedule
```

Fleet will first scan all the 4 clusters in the fleet; they all have the `region` label, with
Expand Down Expand Up @@ -217,12 +217,12 @@ spec:
placementType: PickN
numberOfClusters: 2
topologySpreadConstraints:
- maxSkew: 2
topologyKey: region
whenUnsatisfiable: DoNotSchedule
- maxSkew: 3
topologyKey: environment
whenUnsatisfiable: ScheduleAnyway
- maxSkew: 2
topologyKey: region
whenUnsatisfiable: DoNotSchedule
- maxSkew: 3
topologyKey: environment
whenUnsatisfiable: ScheduleAnyway
```

> Note
Expand Down

0 comments on commit 3ac18b5

Please sign in to comment.