Skip to content

feat: add nodeSelector, tolerations, and affinity support#220

Open
mikaeld wants to merge 3 commits intomainfrom
feat/add-scheduling-fields
Open

feat: add nodeSelector, tolerations, and affinity support#220
mikaeld wants to merge 3 commits intomainfrom
feat/add-scheduling-fields

Conversation

@mikaeld
Copy link
Copy Markdown

@mikaeld mikaeld commented Mar 27, 2026

Summary

  • Adds nodeSelector, tolerations, and affinity as optional pod-level scheduling fields for workloads (Deployments, Rollouts) and tasks (Jobs, CronJobs)
  • Adds schema validation for all three fields in values.schema.json
  • Adds documentation and examples in values.yaml

Motivation

Tenants need the ability to schedule workloads onto specific node pools (e.g. high-memory, GPU, or dedicated pools) using standard Kubernetes scheduling primitives.

Usage example

workloads:
  my-workload:
    nodeSelector:
      cloud.google.com/gke-nodepool: high-memory-pool
    tolerations:
      - key: dedicated
        operator: Equal
        value: high-memory
        effect: NoSchedule

Test

Values

  workloads:
    default:
      nodeSelector:
        tenant: ingestion-sink
      tolerations:
        - key: tenant
          operator: Equal
          value: ingestion-sink
          effect: NoSchedule

Helm template output

apiVersion: apps/v1
kind: Deployment
metadata:
  name: structured-decoded-loader
      [...]
      nodeSelector:
        tenant: ingestion-sink
      tolerations:
        - effect: NoSchedule
          key: tenant
          operator: Equal
          value: ingestion-sink

Related

…eduling

Allow workloads, jobs, and cronjobs to target specific node pools
via standard Kubernetes scheduling fields (nodeSelector, tolerations,
affinity). These are optional pod-level fields rendered in the pod
spec of Deployments, Rollouts, and Jobs.
@mikaeld mikaeld requested a review from a team as a code owner March 27, 2026 14:58
@mikaeld mikaeld self-assigned this Mar 27, 2026
@mikaeld mikaeld added the minor New functionality, backwards compatible. label Mar 27, 2026
@emaydeck-mozilla
Copy link
Copy Markdown
Contributor

Would you mind uncommenting the empty key/value pairs you added to values.yaml? Since they're empty, your if statements should still evaluate as false and uncommenting them will allow helm-docs to pick up on them for the readme.

Otherwise, this looks good. Thanks for getting it added!

Copy link
Copy Markdown
Contributor

@emaydeck-mozilla emaydeck-mozilla left a comment

Choose a reason for hiding this comment

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

I'd love to get #219 merged before this so we can test that out as a release process. Let me ping you once that's done.

mikaeld added 2 commits March 27, 2026 13:09
Uncomment affinity, nodeSelector, and tolerations default values in
values.yaml so helm-docs can detect them for README generation. Empty
values still evaluate as false in template conditionals.
Add affinity, nodeSelector, and tolerations entries to the
auto-generated values table in the README.
@emaydeck-mozilla emaydeck-mozilla force-pushed the feat/add-scheduling-fields branch from 9188f7f to 332676c Compare March 27, 2026 22:06
@emaydeck-mozilla emaydeck-mozilla added minor New functionality, backwards compatible. and removed minor New functionality, backwards compatible. labels Mar 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Chart Version Preview

The following charts will be bumped when this PR is merged:

Chart Current Version New Version
mozcloud 0.15.2 0.16.0
Dry run; no changes made.
Release type: minor (set via PR label - apply patch, minor, major, or no-release to override)

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

Labels

minor New functionality, backwards compatible.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants