Skip to content

helm: add global.nodeSelector propagated to all pod specs#312

Closed
Soju06 wants to merge 3 commits intomainfrom
helm/global-nodeselector
Closed

helm: add global.nodeSelector propagated to all pod specs#312
Soju06 wants to merge 3 commits intomainfrom
helm/global-nodeselector

Conversation

@Soju06
Copy link
Copy Markdown
Owner

@Soju06 Soju06 commented Apr 3, 2026

Summary

  • Add global.nodeSelector that merges with per-resource nodeSelector across all pod specs
  • Applies to: deployment, migration job, helm tests
  • Local nodeSelector values take precedence over global

Motivation

On ARM-only clusters (e.g., OCI A1.Flex, AWS Graviton), every pod must have kubernetes.io/arch: arm64. Currently users must set nodeSelector on each component separately. global.nodeSelector sets it once.

Changes

  • values.yaml: Add global.nodeSelector
  • _helpers.tpl: Add codex-lb.nodeSelector merge helper
  • deployment.yaml: Use merged nodeSelector
  • hooks/migration-job.yaml: Use merged nodeSelector
  • tests/test-connection.yaml: Use merged nodeSelector

@Soju06
Copy link
Copy Markdown
Owner Author

Soju06 commented Apr 3, 2026

Consolidating into 2 PRs: chart features + docs

@Soju06 Soju06 closed this Apr 3, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a273d14bb8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

{{- toYaml . | nindent 8 }}
{{- end }}
{{- with (include "codex-lb.nodeSelector" .) }}
nodeSelector:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Fix pod-spec indentation for deployment nodeSelector

The nodeSelector key in deployment.yaml is indented one space deeper than the surrounding pod-spec fields. When global.nodeSelector or nodeSelector is set, this block is emitted and no longer aligns with sibling keys like tolerations, producing invalid manifest structure and causing Helm render/apply failures for node-pinned deployments.

Useful? React with 👍 / 👎.

{{- if .Values.postgresql.enabled }}
{{- end }}
{{- with (include "codex-lb.nodeSelector" .) }}
nodeSelector:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Correct migration hook nodeSelector indentation

The new nodeSelector block in the migration Job pod spec is also indented one space too far. If a selector is configured, this emits misaligned YAML relative to other keys in spec.template.spec, which breaks manifest parsing and prevents the migration hook from rendering/installing.

Useful? React with 👍 / 👎.

template:
spec:
restartPolicy: OnFailure
{{- with .Values.nodeSelector }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Apply merged global selector to db-init hook pod

The db-init Job still reads only .Values.nodeSelector, so deployments that rely on the new global.nodeSelector alone will not propagate selectors to this hook pod. In environments where scheduling requires explicit node labels (for example single-arch pools), the pre-install db-init hook can remain unschedulable and block installation.

Useful? React with 👍 / 👎.

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.

1 participant