8000 Render the operator Helm chart's resources and scheduling from values by DrFaust92 · Pull Request #55561 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Render the operator Helm chart's resources and scheduling from values - #55561

Open
DrFaust92 wants to merge 1 commit into
keycloak:mainfrom
DrFaust92:operator-helm-values
Open

DrFaust92 wants to merge 1 commit into
keycloak:mainfrom
DrFaust92:operator-helm-values

Conversation

@DrFaust92
@DrFaust92 DrFaust92 commented Nov 25, 2026 •
Copy link
Copy Markdown

Closes #55262
Closes #54334

The generated operator Helm chart renders each resource request and limit as its own field, so none can be removed (#54334), and it has no way to set the operator pod's affinity, node selector or tolerations (#55262).

This works with the quarkus-helm version Keycloak already gets from the platform BOM (1.4.1); no version bump is needed:

  • Resources: a quarkus.helm.expressions entry replaces the generated resources block with {{- toYaml .Values.operator.resources | nindent 12 }}. values.yaml keeps the same defaults, and a request or limit set to null is dropped, e.g. --set operator.resources.limits.cpu=null.
  • Scheduling: quarkus-helm 1.4.1 can only replace paths that exist in the generated Deployment, so a partial Deployment in operator/src/main/kubernetes/kubernetes.yml adds affinity: {} and nodeSelector: {kubernetes.io/os: linux}. Quarkus merges it into the generated Deployment (so the kubectl manifests get them too), and expressions plus quarkus.helm.values-schema types turn them into operator.affinity and operator.nodeSelector. operator.tolerations is rendered from the same expression, only when set. An empty nodeSelector: {} or tolerations: [] placeholder is dropped by the merge, hence the node selector default and the tolerations handling.
  • Docs: the values table in the Operator installation guide lists the new values.
  • CI: a new helm template — resources and scheduling values step in the Helm job checks them.

quarkus-helm 1.5.0 (quarkiverse/quarkus-helm#549) lets expressions create missing fields, so the placeholders could go once the platform BOM ships it (quarkiverse/quarkus-operator-sdk#1445).

Testing

  • ./mvnw -Poperator -Pcluster-wide -pl :keycloak-operator -am package -DskipTests, then helm lint --strict on the generated chart.
  • helm template with defaults: same Deployment as the published 26.8.2 chart apart from affinity: {} and the kubernetes.io/os: linux node selector.
  • With operator.resources.limits.cpu=null, a pod anti-affinity, a NoSchedule toleration and operator.nodeSelector.pool=ops: no CPU limit, the other requests/limits unchanged, and the affinity, toleration and both node selector entries rendered; the output parses as YAML.
  • The new CI step passes against the chart built from this branch and fails against the published 26.8.2 chart.

This PR was prepared with an AI assistant (Claude Code) and reviewed by me.

@DrFaust92
DrFaust92 marked this pull request as ready for review November 25, 2026 23:47
@DrFaust92
DrFaust92 requested review from a team as code owners November 25, 2026 23:47
Copilot AI balanced review requested due to automatic review settings November 25, 2026 23:47
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The CI assertion treats missing and explicitly null cpu fields alike, so it fails to catch the reported invalid-rendering regression.

1 open issue
What changed in this PR

This PR makes the generated Operator Helm chart’s resources and pod scheduling configurable, addressing #54334 and #55262 without upgrading quarkus-helm.

Changes:

  • Renders resources as a whole object so individual requests or limits can be removed with null.
  • Adds affinity, node selector, and toleration values, with Deployment placeholders needed by quarkus-helm 1.4.1.
  • Documents the new values and adds CI checks for resource removal and scheduling overrides.
File Description
operator/​src/​main/​resources/​application.properties Adds Helm expressions and scheduling value schemas.
operator/​src/​main/​kubernetes/​kubernetes.yml Adds affinity and Linux node selector placeholders.
docs/​guides/​operator/​installation.adoc Documents resource removal and scheduling values.
.github/​workflows/​operator-ci.yml Adds rendering checks for resource and scheduling overrides.

Review effort: Balanced

Comment thread .github/workflows/operator-ci.yml Resolved
The generated chart rendered each resource request and limit individually,
so none could be removed, and it had no way to set the operator pod's
affinity, node selector or tolerations.

- Replace the generated resources block with a toYaml of
  operator.resources through a quarkus.helm expression. The defaults are
  unchanged, and a request or limit set to null is dropped.
- Add affinity and a kubernetes.io/os node selector to the operator
  Deployment through src/main/kubernetes/kubernetes.yml, and render them,
  plus optional tolerations, from operator.affinity, operator.nodeSelector
  and operator.tolerations. This works with the quarkus-helm version from
  the platform BOM; empty nodeSelector/tolerations placeholders are dropped
  by the merge, hence the node selector default.
- Document the values and check them in the Helm CI job.

Closes keycloak#55262
Closes keycloak#54334

Signed-off-by: drfaust92 <ilia.lazebnik@gmail.com>
@DrFaust92
DrFaust92 force-pushed the operator-helm-values branch from a144e2e to e194a58 Compare November 26, 2026 00:02
Copilot AI balanced review requested due to automatic review settings November 26, 2026 00:02
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the Operator Helm resource and pod scheduling configuration changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Operator helm chart: add option to set operator pod affinity Operator Helm chart: a resource request or limit cannot be removed (e.g. the CPU limit)

2 participants

0