Skip to content

[PM-19673] Add nodeSelector and tolerations #239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

Invincibear
Copy link
Contributor

🎟️ Tracking

This is a re-implementation of #168, a PR that was never merged in due to not signing the disclosure agreement (which I have)

📔 Objective

Adds support to all templates for specifying nodeSelector & tolerations

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@S-Kakar
Copy link

S-Kakar commented Mar 29, 2025

Thank you for your contribution! We've added this to our internal Community PR board for review.
ID: PM-19673

@S-Kakar S-Kakar changed the title Add nodeSelector and tolerations [PM-19673] Add nodeSelector and tolerations Mar 29, 2025
@S-Kakar S-Kakar added in-product-review Community PR is being reviewed by Bitwarden's Product team community-pr labels Mar 29, 2025
tolerations should be array of objects
@Invincibear
Copy link
Contributor Author

Invincibear commented Mar 29, 2025

I forgot to update charts/sm-operator/values.yaml to tolerations: [], I pushed the changes and am waiting for tests to run.

charts/self-host$ helm lint .
==> Linting .

1 chart(s) linted, 0 chart(s) failed
charts/sm-operator$ helm lint .
==> Linting .

1 chart(s) linted, 0 chart(s) failed

@Invincibear Invincibear requested a review from a team as a code owner May 2, 2025 05:41
@Invincibear Invincibear requested a review from Eeebru May 2, 2025 05:41
@mimartin12 mimartin12 requested review from mimartin12 and removed request for Eeebru June 9, 2025 17:21
@CLAassistant
Copy link

CLAassistant commented Jun 9, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

github-actions bot commented Jun 9, 2025

Logo
Checkmarx One – Scan Summary & Detailsce441793-338e-41f4-ad94-5dd7316f9130

Great job, no security vulnerabilities found in this Pull Request

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds support for specifying nodeSelector and tolerations across both the sm-operator and self-host Helm charts.

  • Extended the values schema in both charts to include nodeSelector and tolerations with sensible defaults.
  • Updated values.yaml for self-host to define these defaults at global and per-component levels.
  • Injected conditional blocks in all relevant templates to render nodeSelector and tolerations into pod specs.

Reviewed Changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.

Show a summary per file
File Description
charts/sm-operator/values.schema.json Added nodeSelector and tolerations under containers
charts/sm-operator/templates/deployment.yaml Injected nodeSelector/tolerations into deployment spec
charts/self-host/values.yaml Defined global and component defaults for selectors and tolerations
charts/self-host/values.schema.json Expanded schema with new properties for all components
charts/self-host/templates/web.yaml Added conditional rendering of selectors and tolerations
charts/self-host/templates/sso.yaml Added conditional rendering of selectors and tolerations
charts/self-host/templates/scim.yaml Added conditional rendering of selectors and tolerations
charts/self-host/templates/pre-install-secret-sql.yaml Enabled selectors and tolerations in hook spec
charts/self-host/templates/pre-install-job.yaml Enabled selectors and tolerations in job spec
charts/self-host/templates/pre-install-db-migrator-job.yaml Enabled selectors and tolerations in migrator job spec
charts/self-host/templates/post-install-db-migrator-job.yaml Enabled selectors and tolerations in migrator job spec
charts/self-host/templates/post-delete-hook.yaml Enabled selectors and tolerations in hook spec
charts/self-host/templates/notifications.yaml Added conditional rendering of selectors and tolerations
charts/self-host/templates/mssql.yaml Enabled selectors and tolerations for mssql pods
charts/self-host/templates/identity.yaml Added conditional rendering of selectors and tolerations
charts/self-host/templates/icons.yaml Added conditional rendering of selectors and tolerations
charts/self-host/templates/events.yaml Added conditional rendering of selectors and tolerations
charts/self-host/templates/attachments.yaml Added conditional rendering of selectors and tolerations
charts/self-host/templates/api.yaml Added conditional rendering of selectors and tolerations
charts/self-host/templates/admin.yaml Added conditional rendering of selectors and tolerations
Comments suppressed due to low confidence (3)

charts/self-host/templates/web.yaml:28

  • Because general.nodeSelector defaults to {} (a non-nil map), this if condition always evaluates to true, resulting in an empty nodeSelector block being rendered even when no selector is provided. Consider checking for non-empty values (e.g., using len) or allowing null defaults.
{{- if or .Values.component.web.nodeSelector .Values.general.nodeSelector }}

charts/self-host/templates/sso.yaml:28

  • [nitpick] This block is duplicated across many templates. Consider extracting a helper in _helpers.tpl to render nodeSelector and tolerations, reducing repetition and easing future updates.
{{- if or .Values.component.sso.nodeSelector .Values.general.nodeSelector }}

@mimartin12 mimartin12 self-assigned this Jun 10, 2025
@mimartin12
Copy link
Collaborator

@Invincibear , working through some CI blockers, we will get this merged once CI passes 😄 .

Copy link

@mimartin12 mimartin12 merged commit 24a1983 into bitwarden:main Jun 11, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-pr in-product-review Community PR is being reviewed by Bitwarden's Product team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants