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:
Viktor Barzin 2026-03-15 19:11:44 +00:00
parent 29c98aaea8
commit f0312df2be

View file

@ -927,17 +927,19 @@ resource "kubernetes_manifest" "mutate_gpu_priority" {
mutate = {
patchesJson6902 = yamlencode([
{
op = "remove"
path = "/spec/priority"
},
{
op = "remove"
path = "/spec/preemptionPolicy"
},
{
op = "add"
op = "replace"
path = "/spec/priorityClassName"
value = "gpu-workload"
},
{
op = "replace"
path = "/spec/priority"
value = 1200000
},
{
op = "replace"
path = "/spec/preemptionPolicy"
value = "PreemptLowerPriority"
}
])
}