Skip to content

feat(helm): Make all container images configurable in values.yaml (resolves #2047). - #2305

Merged
Nathan903 merged 9 commits into
y-scope:mainfrom
Nathan903:move-values-yaml
Jun 4, 2026
Merged

feat(helm): Make all container images configurable in values.yaml (resolves #2047).#2305
Nathan903 merged 9 commits into
y-scope:mainfrom
Nathan903:move-values-yaml

Conversation

@Nathan903

@Nathan903 Nathan903 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Description

Third-party container images (MariaDB, MySQL, MongoDB, RabbitMQ, Redis, kubectl) were hardcoded directly in Helm template files. Only the CLP package image was configurable through values.yaml. This made it impossible to use private registry mirrors or prepare the chart for AWS Marketplace, which requires all image references to be in values.yaml.

Changes:

  • Added image.database (with mariadb/mysql variants), image.queue, image.redis, image.resultsCache entries to values.yaml. The database image is selected based on clpConfig.database.type.
  • Generalized the clp.image.ref helper template to accept a component parameter (and optional variant for database). The AppVersion fallback only applies to clpPackage; all other components require an explicit tag.
  • Removed clp.kubectl.image.ref helper (merged into the generalized clp.image.ref).
  • Updated all four statefulset templates (database, queue, redis, results-cache) to use the helper instead of hardcoded images. imagePullPolicy is now configurable per component.
  • Updated the K8s deployment docs to show the new configurable image entries.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

helm template test .
helm lint tools/deployment/package-helm/
./tools/deployment/package-helm/set-up-test.sh
./tools/deployment/package-helm/set-up-test.sh --clp-package-image ghcr.io/y-scope/clp/clp-package:main

Summary by CodeRabbit

  • New Features

    • Per-component configurable container images for bundled services (database: MariaDB/MySQL, queue, results cache, Redis, RabbitMQ, kubectl helper and app packages) via Helm values, supporting repository, tag or digest and pullPolicy.
  • Documentation

    • Deployment guide example updated to show overriding third‑party image repositories, tags and digests.
  • Chores

    • Helm chart version bumped.

@Nathan903
Nathan903 requested a review from a team as a code owner June 2, 2026 20:05
@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR generalizes Helm image handling: a new component-aware image helper and values were added; setup scripts now pass component keys; chart templates were updated to use the new helper and read component image/pullPolicy values; docs show example image overrides.

Changes

Component-based image reference refactoring

Layer / File(s) Summary
Helm helper generalization and values foundation
tools/deployment/package-helm/templates/_helpers.tpl, tools/deployment/package-helm/values.yaml, tools/deployment/package-helm/Chart.yaml
Introduce clp.imageRef (dict { root, component }) that renders repository@digest or repository:tag, defaults clpPackage tag to Chart.AppVersion, enforces tags for other components; add image.clpPackage.{database,queue,redis,resultsCache} entries and kubectl image pullPolicy; bump chart version.
Setup script image plumbing refactor
tools/deployment/package-helm/.set-up-common.sh, tools/deployment/package-helm/set-up-multi-dedicated-test.sh, tools/deployment/package-helm/set-up-multi-shared-test.sh, tools/deployment/package-helm/set-up-test.sh
get_image_helm_args signature changed to (cluster_name, component, [image]) and now emits Helm --set flags under image.${component}.{repository,tag,pullPolicy}. Test setup scripts updated to pass "clpPackage" as the component argument.
Deployment template image reference migrations
tools/deployment/package-helm/templates/...
Deployment/StatefulSet/Job templates updated to call include "clp.imageRef" (dict "root" . "component" "<component>") and quote results where needed. Database, queue, redis, and results-cache now use .Values.image[<component>] and configurable imagePullPolicy. Presto initContainer switched to component: "kubectl".
Documentation of image override configuration
docs/src/user-docs/guides-k8s-deployment.md
Add image subsection to custom-values.yaml example showing how to override bundled third-party images (MariaDB, MySQL, Redis, RabbitMQ, Mongo results cache) and kubectl (including a digest example).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • y-scope/clp#2020: Modifies get_image_helm_args and related setup-script image-argument plumbing in a similar area; likely related to this image-override refactor.

Suggested reviewers

  • junhaoliao
  • hoophalab
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely summarizes the primary change: making all container images configurable in values.yaml instead of hardcoded in templates.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/src/user-docs/guides-k8s-deployment.md`:
- Around line 216-218: The kubectl image reference is using a non-standard tag
"sha256-..." which will fail; update the kubectl entry so the digest is
expressed as a repository digest (repository: "bitnami/kubectl@sha256:<digest>")
or replace tag with a proper version string (tag: "1.30.0"), i.e., move the
sha256 value into the repository with an "`@sha256`:" prefix or use a semantic
version in the tag field; edit the kubectl block and adjust the repository and
tag keys accordingly.

In `@tools/deployment/package-helm/templates/_helpers.tpl`:
- Around line 141-155: The helper "clp.image.ref" always emits repository:tag
and drops digest-pinned images; update that template so after resolving $img and
$tag it checks for an optional digest field (e.g., $img.digest) and, if present,
returns "repository@digest" instead of "%s:%s", otherwise keep the existing tag
logic (including the clpPackage fallback to .root.Chart.AppVersion and the fail
when tag is required). Ensure you reference the same symbols ($img, $tag,
.component, .root.Values.image) and use the digest path when available so
digest-pinned third-party images are preserved.

In `@tools/deployment/package-helm/templates/presto-worker-deployment.yaml`:
- Around line 33-35: The initContainer named "setup-configs" uses the
component-based kubectl image via the include "clp.image.ref" but does not set
imagePullPolicy, so .Values.image.kubectl.pullPolicy is ignored; update the
initContainer spec for setup-configs to add imagePullPolicy and wire it to the
Helm value (the same place other migrated components read
.Values.image.kubectl.pullPolicy) so the pull policy is honored consistently for
the kubectl image.

In `@tools/deployment/package-helm/values.yaml`:
- Around line 25-28: The kubectl image tag is currently a digest string which
will be rendered as repository:tag by clp.image.ref and causes ImagePullBackOff;
update the kubectl tag field (in the kubectl block) to a real version tag (e.g.,
"v1.36.0" or the Bitnami-provided semver) so clp.image.ref produces a valid
repository:tag and clp.waitFor initContainers can pull the image successfully;
modify the tag key under kubectl (not repository or pullPolicy) accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 011f710c-f52f-4d44-b73d-30d427fc4cdb

📥 Commits

Reviewing files that changed from the base of the PR and between 6bcecd8 and a968c0d.

📒 Files selected for processing (24)
  • docs/src/user-docs/guides-k8s-deployment.md
  • tools/deployment/package-helm/.set-up-common.sh
  • tools/deployment/package-helm/set-up-multi-dedicated-test.sh
  • tools/deployment/package-helm/set-up-multi-shared-test.sh
  • tools/deployment/package-helm/set-up-test.sh
  • tools/deployment/package-helm/templates/_helpers.tpl
  • tools/deployment/package-helm/templates/api-server-deployment.yaml
  • tools/deployment/package-helm/templates/compression-scheduler-deployment.yaml
  • tools/deployment/package-helm/templates/compression-worker-deployment.yaml
  • tools/deployment/package-helm/templates/database-statefulset.yaml
  • tools/deployment/package-helm/templates/db-table-creator-job.yaml
  • tools/deployment/package-helm/templates/garbage-collector-deployment.yaml
  • tools/deployment/package-helm/templates/log-ingestor-deployment.yaml
  • tools/deployment/package-helm/templates/mcp-server-deployment.yaml
  • tools/deployment/package-helm/templates/presto-worker-deployment.yaml
  • tools/deployment/package-helm/templates/query-scheduler-deployment.yaml
  • tools/deployment/package-helm/templates/query-worker-deployment.yaml
  • tools/deployment/package-helm/templates/queue-statefulset.yaml
  • tools/deployment/package-helm/templates/redis-statefulset.yaml
  • tools/deployment/package-helm/templates/reducer-deployment.yaml
  • tools/deployment/package-helm/templates/results-cache-indices-creator-job.yaml
  • tools/deployment/package-helm/templates/results-cache-statefulset.yaml
  • tools/deployment/package-helm/templates/webui-deployment.yaml
  • tools/deployment/package-helm/values.yaml

Comment thread docs/src/user-docs/guides-k8s-deployment.md Outdated
Comment thread tools/deployment/package-helm/templates/_helpers.tpl Outdated
Comment thread tools/deployment/package-helm/values.yaml Outdated
@Nathan903 Nathan903 linked an issue Jun 2, 2026 that may be closed by this pull request

@coderabbitai coderabbitai Bot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tools/deployment/package-helm/templates/_helpers.tpl (1)

157-157: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Error message omits variant when present.

When a variant is supplied (e.g., component: "database", variant: "mariadb"), the fail message will read image.database.tag is required instead of image.database.mariadb.tag is required, which obscures the actual path in values.yaml and makes debugging harder.

📝 Proposed fix to include variant in error message
+{{- $componentPath := .component -}}
+{{- if hasKey . "variant" -}}
+  {{- $componentPath = printf "%s.%s" .component .variant -}}
+{{- end -}}
 {{- if not $tag -}}
   {{- if eq .component "clpPackage" -}}
     {{- $tag = .root.Chart.AppVersion -}}
   {{- else -}}
-    {{- fail (printf "image.%s.tag is required" .component) -}}
+    {{- fail (printf "image.%s.tag is required" $componentPath) -}}
   {{- end -}}
 {{- end -}}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tools/deployment/package-helm/templates/_helpers.tpl` at line 157, The fail
message always uses only .component; update the failing call that currently uses
fail (printf "image.%s.tag is required" .component) so it includes .variant when
present by constructing the key conditionally (e.g., if .variant is set, printf
"image.%s.%s.tag is required" .component .variant, otherwise keep the existing
format) and call fail with that resulting message; refer to the template
variables .component, .variant and the existing fail(printf ...) invocation to
locate where to change it.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@tools/deployment/package-helm/templates/_helpers.tpl`:
- Line 157: The fail message always uses only .component; update the failing
call that currently uses fail (printf "image.%s.tag is required" .component) so
it includes .variant when present by constructing the key conditionally (e.g.,
if .variant is set, printf "image.%s.%s.tag is required" .component .variant,
otherwise keep the existing format) and call fail with that resulting message;
refer to the template variables .component, .variant and the existing
fail(printf ...) invocation to locate where to change it.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a885d21c-a819-412c-868d-20d294d2c12b

📥 Commits

Reviewing files that changed from the base of the PR and between 33a5fc7 and ee06b43.

📒 Files selected for processing (2)
  • tools/deployment/package-helm/templates/_helpers.tpl
  • tools/deployment/package-helm/templates/presto-worker-deployment.yaml

@Nathan903
Nathan903 requested a review from junhaoliao June 3, 2026 07:20
Comment thread tools/deployment/package-helm/templates/_helpers.tpl
Comment thread tools/deployment/package-helm/templates/_helpers.tpl Outdated
Comment thread tools/deployment/package-helm/values.yaml Outdated
Comment thread tools/deployment/package-helm/templates/database-statefulset.yaml Outdated
Comment thread docs/src/user-docs/guides-k8s-deployment.md Outdated
Comment thread tools/deployment/package-helm/templates/webui-deployment.yaml Outdated
Comment thread tools/deployment/package-helm/templates/presto-worker-deployment.yaml Outdated
Comment thread tools/deployment/package-helm/templates/queue-statefulset.yaml Outdated
Comment thread tools/deployment/package-helm/templates/redis-statefulset.yaml Outdated
Comment thread tools/deployment/package-helm/templates/results-cache-statefulset.yaml Outdated
Nathan903 and others added 2 commits June 3, 2026 11:34
Co-authored-by: Junhao Liao <junhao@junhao.ca>

@junhaoliao junhaoliao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

in my opinion there is no BREAKING behaviourial change in this PR given the same images are used, and the pull policies remain the same as before. We are only exposing the configuration interfaces to the user in the PR.

for the title, how about:

feat(helm): Make all container images configurable in `values.yaml` (resolves #2047).

@Nathan903 Nathan903 changed the title feat(helm)!: Make all container images configurable in values.yaml feat(helm): Make all container images configurable in values.yaml (resolves #2047). Jun 4, 2026
@Nathan903
Nathan903 merged commit 2e17f95 into y-scope:main Jun 4, 2026
29 checks passed
@Nathan903
Nathan903 deleted the move-values-yaml branch June 4, 2026 14:37
@junhaoliao junhaoliao added this to the June 2026 milestone Jul 13, 2026
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.

Make all container images configurable in values.yaml

2 participants