fix gpu-workload Kyverno policy: use replace with explicit priority value
The API server doesn't re-resolve priority from PriorityClassName after webhook mutation. Changed from remove+add to replace with explicit priority=1200000 and preemptionPolicy=PreemptLowerPriority.
This commit is contained in:
parent
29c98aaea8
commit
f0312df2be
1 changed files with 11 additions and 9 deletions
|
|
@ -927,17 +927,19 @@ resource "kubernetes_manifest" "mutate_gpu_priority" {
|
||||||
mutate = {
|
mutate = {
|
||||||
patchesJson6902 = yamlencode([
|
patchesJson6902 = yamlencode([
|
||||||
{
|
{
|
||||||
op = "remove"
|
op = "replace"
|
||||||
path = "/spec/priority"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
op = "remove"
|
|
||||||
path = "/spec/preemptionPolicy"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
op = "add"
|
|
||||||
path = "/spec/priorityClassName"
|
path = "/spec/priorityClassName"
|
||||||
value = "gpu-workload"
|
value = "gpu-workload"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
op = "replace"
|
||||||
|
path = "/spec/priority"
|
||||||
|
value = 1200000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
op = "replace"
|
||||||
|
path = "/spec/preemptionPolicy"
|
||||||
|
value = "PreemptLowerPriority"
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue