Skip to content

Commit

Permalink
fix typo in docs (#1736)
Browse files Browse the repository at this point in the history
- fixes doc typo
- adds additional unit tests

Updates #1735
  • Loading branch information
tzneal authored Apr 28, 2022
1 parent f9f3fcf commit ee450bc
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
38 changes: 38 additions & 0 deletions pkg/controllers/provisioning/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,44 @@ var _ = Describe("Provisioning", func() {
Expect(node.Spec.Taints).To(ContainElement(v1.Taint{Key: v1alpha5.NotReadyTaintKey, Effect: v1.TaintEffectNoSchedule}))
}
})
It("should schedule pods that tolerate taints", func() {
provisioner := test.Provisioner(test.ProvisionerOptions{Taints: []v1.Taint{{Key: "nvidia.com/gpu", Value: "true", Effect: v1.TaintEffectNoSchedule}}})
ExpectApplied(ctx, env.Client, provisioner)
for _, pod := range ExpectProvisioned(ctx, env.Client, controller,
test.UnschedulablePod(
test.PodOptions{Tolerations: []v1.Toleration{
{
Key: "nvidia.com/gpu",
Operator: v1.TolerationOpEqual,
Value: "true",
Effect: v1.TaintEffectNoSchedule,
},
}}),
test.UnschedulablePod(
test.PodOptions{Tolerations: []v1.Toleration{
{
Key: "nvidia.com/gpu",
Operator: v1.TolerationOpExists,
Effect: v1.TaintEffectNoSchedule,
},
}}),
test.UnschedulablePod(
test.PodOptions{Tolerations: []v1.Toleration{
{
Key: "nvidia.com/gpu",
Operator: v1.TolerationOpExists,
},
}}),
test.UnschedulablePod(
test.PodOptions{Tolerations: []v1.Toleration{
{
Operator: v1.TolerationOpExists,
},
}}),
) {
ExpectScheduled(ctx, env.Client, pod)
}
})
})
})

Expand Down
4 changes: 2 additions & 2 deletions website/content/en/preview/tasks/provisioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ spec:
values: ["p3.8xlarge", "p3.16xlarge"]
taints:
- key: nvidia.com/gpu
value: true
effect: NoSchedule
value: "true"
effect: NoSchedule
```
In order for a pod to run on a node defined in this provisioner, it must tolerate `nvidia.com/gpu` in its pod spec.

0 comments on commit ee450bc

Please sign in to comment.