Skip to content

orchestratord: allow setting a PriorityClass on environmentd and clusterd pods - #38457

Open
jazz-mo wants to merge 1 commit into
MaterializeInc:mainfrom
jazz-mo:jazz/priority-class-name
Open

orchestratord: allow setting a PriorityClass on environmentd and clusterd pods#38457
jazz-mo wants to merge 1 commit into
MaterializeInc:mainfrom
jazz-mo:jazz/priority-class-name

Conversation

@jazz-mo

@jazz-mo jazz-mo commented Aug 25, 2026

Copy link
Copy Markdown

Why

The operator sets no priority class on environmentd or clusterd pods. Higher priority pods evict them when a node fills up. One eviction aborted a deploy mid-hydration.

What

Users set environmentd.priorityClassName and clusterd.priorityClassName to apply priority classes to those pods. Both values default to unset, which renders no argument and changes no pod spec. The clusterd argument requires environmentd v26.40 or newer. This matches how clusterd.affinity and clusterd.tolerations are already gated. Older environmentd versions exit on unrecognized arguments. We exclude balancerd and console because they hold no state and run multiple replicas.

Before you set it

  • The values do not reach running pods until a user requests a rollout.
  • Kubernetes caps a user-defined class at 1000000000 and system-cluster-critical is 2000000000, so these pods remain vulnerable to critical preemptors.
  • Prefer a class with preemptionPolicy: Never to prevent new pods from evicting serving pods during the rollout.

Testing

Helm unit tests use notMatchRegex for negative assertions. The notContains function compares whole list elements, so it never fails against a flag rendered as --flag=value. The pre-existing schedulerName assertion has the same defect and is fixed here. An mzcompose test asserts the resolved integer priority to prove Kubernetes admitted the class.

Open: I omitted the Chart.yaml version bump because a script manages it and PR #38406 omitted it, but which rule is live?

…terd pods

The operator sets no priority class on environmentd or clusterd pods, so they
run at priority 0. Any higher-priority pod can evict them when a node fills up.
A clusterd replica preempted mid-hydration aborts the deploy, and the chart has
no way to raise these pods.

Add `environmentd.priorityClassName` and `clusterd.priorityClassName`, next to
the per-component node selectors, affinities and tolerations both components
already have. Each becomes an orchestratord argument.
`environmentd.priorityClassName` sets `priorityClassName` on the environmentd
StatefulSet's pod template. `clusterd.priorityClassName` is forwarded to
environmentd as `--orchestrator-kubernetes-priority-class-name` and applied
there to clusterd pod specs. Both default to unset, which renders no argument
and leaves every pod spec unchanged.

The forwarded argument is gated on `meets_minimum_version(&V26_40_0)`, matching
how `clusterd.affinity` and `clusterd.tolerations` are gated on `V144`.
environmentd exits on an unrecognized argument, so an instance pinned to an
older `environmentdImageRef` would otherwise fail to start once the value was
set.

balancerd and console are left out. Both default to two replicas and neither
holds state, so an eviction costs a connection rather than a rehydration.

The negative chart assertions use `notMatchRegex`. `notContains` compares whole
list elements, so it cannot fail against a flag rendered as `--flag=value`. The
existing `schedulerName` assertion has the same defect and is fixed here.
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your submission! We really appreciate it. Like many source-available projects, we require that you sign our Contributor License Agreement (CLA) before we can accept your contribution.

You can sign the CLA by posting a comment with the message below.


I have read the Contributor License Agreement (CLA) and I hereby sign the CLA.


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@jazz-mo

jazz-mo commented Aug 25, 2026

Copy link
Copy Markdown
Author

I have read the Contributor License Agreement (CLA) and I hereby sign the CLA.

@jazz-mo
jazz-mo marked this pull request as ready for review August 25, 2026 14:20
@jazz-mo
jazz-mo requested review from a team as code owners August 25, 2026 14:20
@jazz-mo
jazz-mo requested a review from jubrad August 25, 2026 14:20
# -- PriorityClass to use for environmentd pods spawned by the operator. The
# PriorityClass must already exist. Kubernetes rejects a pod that names one
# it cannot resolve, so a typo here stops these pods being created at all.
priorityClassName:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most helm charts default priorityClassName to "" rather than null (having an empty yaml value isn't a great yaml practice). Since you are using an if ...priorityClassName in your helm template, nothing changes on that side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants