terraform-provider-kubernetes
terraform-provider-kubernetes copied to clipboard
Support non-preempting priority classes
Description
The feature has been in beta since 1.19. It boils down to a new field,
PreemptionPolicy: PreemptLowerPriority (default) | Never
References
https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#non-preempting-priority-class
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Is there a workaround to adding this to our cluster until this implemented? I've tried adding a PriorityClass via terraform, then adding the PreemptionPolicy manually, to see if it could be imported, but I have not had any success.
@pduboucher I'm currently using kubectl_manifest from this provider: gavinbunney/kubectl
resource "kubectl_manifest" "categorizer-priority" {
yaml_body = yamlencode({
apiVersion = "scheduling.k8s.io/v1"
kind = "PriorityClass"
metadata = {
name = var.priority_class_name
}
value = 100
preemptionPolicy = "Never"
description = "This priority class will not cause other pods to be preempted."
})
}
@pduboucher I'm currently using
kubectl_manifestfrom this provider: gavinbunney/kubectlresource "kubectl_manifest" "categorizer-priority" { yaml_body = yamlencode({ apiVersion = "scheduling.k8s.io/v1" kind = "PriorityClass" metadata = { name = var.priority_class_name } value = 100 preemptionPolicy = "Never" description = "This priority class will not cause other pods to be preempted." }) }
Great, thanks a lot for that - works well!
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.