nats-io / k8s

NATS on Kubernetes with Helm Charts
Apache License 2.0
444 stars 300 forks source link

Add Priority Class Name Configuration to StatefulSet in Helm Chart #878

Closed m1stegmann closed 5 months ago

m1stegmann commented 5 months ago

What motivated this proposal?

This proposal is motivated by the need for better control over the scheduling and prioritization of pods within Kubernetes clusters. The ability to specify a priorityClassName in a StatefulSet allows users to determine the scheduling precedence of their pods, ensuring that more critical services are given preference by the Kubernetes scheduler.

What is the proposed change?

The proposed change is to extend the Helm chart's StatefulSet template to include an option for configuring a priorityClassName. This change would involve adding a new field in the StatefulSet spec within the Helm chart's values file, which users can set to their desired priority class name.

Who benefits from this change?

This change benefits Helm chart users who require fine-grained control over the scheduling priority of their pods, especially in environments where resources are constrained or certain workloads are deemed more critical than others. It enhances the chart's flexibility and usability for a wider range of deployment scenarios.

What alternatives have you evaluated?

The primary alternative considered was manually modifying the StatefulSet manifest after deployment or using kubectl patch to update the priority class name. However, these approaches are less desirable as they introduce additional steps in the deployment process and are not as maintainable or scalable as incorporating the feature directly into the Helm chart.

caleblloyd commented 5 months ago

Try:

podTemplate:
  merge:
    spec:
      priorityClassName: high-priority