terraform-provider-kubernetes icon indicating copy to clipboard operation
terraform-provider-kubernetes copied to clipboard

Support non-preempting priority classes

Open therc opened this issue 4 years ago • 3 comments

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

therc avatar Jun 07 '21 18:06 therc

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 avatar Apr 13 '22 13:04 pduboucher

@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."
  })
}

junaid-ali avatar May 03 '22 14:05 junaid-ali

@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."
  })
}

Great, thanks a lot for that - works well!

pduboucher avatar May 03 '22 14:05 pduboucher

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.

github-actions[bot] avatar Nov 03 '22 02:11 github-actions[bot]