Skip to content

Feature/topologySpreadConstraints ADD - #191

Closed
Mason0920 wants to merge 1 commit into
getredash:masterfrom
Mason0920:master
Closed

Mason0920 wants to merge 1 commit into
getredash:masterfrom
Mason0920:master

Conversation

@Mason0920

Copy link
Copy Markdown
Contributor

Hi,

I need topologySpreadConstraints, so I create PR on this repo

about topologySpreadConstraints, you can visit here

You can use topology spread constraints to control how Pods are spread across your cluster among failure-domains such as regions, zones, nodes, and other user-defined topology domains. This can help to achieve high availability as well as efficient resource utilization.

I would be useful for other users.

@ranyhb

ranyhb commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Thanks for this — the feature is a good addition and it's now in #216, which consolidates it with #195 and #200 into a 4.2.0 release. You're credited via Co-authored-by.

I had to reimplement the templates rather than apply them, because the patch as written stops the chart rendering at all:

Error: parse error at (redash/templates/worker-deployment.yaml:83): bad character U+0024 '$'

.Values.$workerConfig.topologySpreadConstraints isn't valid — a variable can't be used as a field name there. The worker template already has the merged per-worker config in $workerConfig, so it just needs $workerConfig.topologySpreadConstraints (same shape as the nodeSelector and affinity blocks right next to it). Three smaller things: indent 8 should be nindent 8 or the YAML comes out malformed, topologySpreadConstraints is a list so the value wants [] rather than {}, and the chart has since gained a Knative Service template that needed the same block.

With that fixed, per-worker overrides work as you'd expect — workers.adhoc.topologySpreadConstraints beats the shared worker. default. Worth knowing for future PRs: helm template charts/redash catches this class of error immediately.

This will ship in the next chart version (4.2.0). Closing in favour of #216.

@ranyhb ranyhb closed this Aug 25, 2026
ranyhb added a commit that referenced this pull request Aug 26, 2026
* fix: emit SQLALCHEMY_ENABLE_POOL_PRE_PING

values.yaml has documented redash.sqlAlchemyEnablePoolPrePing with a
default of "true" since it was added, but the shared env helper never
emitted the variable, so setting it did nothing.

Upstream: #200

Co-authored-by: brianrudolf <brianrudolf@users.noreply.github.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix: honor postgresql.auth.existingSecret for the database password

REDASH_DATABASE_PASSWORD was hardcoded to the `password` key of the
chart-managed `<release>-postgresql` secret. A release pointing the
bundled PostgreSQL at an existing secret left Redash referencing a
secret that does not exist.

Adds the accompanying postgresql.auth.existingSecret and
postgresql.auth.secretKeys.userPasswordKey values, which the upstream
PR referenced but never declared, so the key does not resolve empty
when only existingSecret is set. Default renders are unchanged.

Upstream: #195

Co-authored-by: seslly <seslly@users.noreply.github.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* feat: add topologySpreadConstraints to all workloads

Exposes topologySpreadConstraints for the server, workers, scheduler
and migrations job, alongside the existing nodeSelector/affinity/
tolerations settings.

Reimplemented rather than applied: the upstream patch referenced
`.Values.$workerConfig.topologySpreadConstraints` in the worker
template, which is not valid template syntax and made the whole chart
fail to render with `bad character U+0024 '$'`. Workers read the
merged $workerConfig, so per-worker overrides of the shared
worker.topologySpreadConstraints default work. The upstream patch also
used `indent 8` where the surrounding blocks use `nindent 8`, which
would have emitted malformed YAML, and declared the value as `{}`
though the field is a list.

Also applied to the Knative Service template, which the upstream PR
predates. Note that Knative gates this PodSpec field, so it needs the
corresponding config-features flag enabled.

Upstream: #191

Co-authored-by: Mason0920 <Mason0920@users.noreply.github.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore: release 4.2.0

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix: add topologySpreadConstraints to Knative pod settings and quote secret names

---------

Co-authored-by: brianrudolf <brianrudolf@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: seslly <seslly@users.noreply.github.com>
Co-authored-by: Mason0920 <Mason0920@users.noreply.github.com>
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