-
Notifications
You must be signed in to change notification settings - Fork 16
HYPERFLEET-1216 - feat: migrate helmfile to OCI chart distribution #80
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,191 @@ | ||
| # Bumping Chart Versions | ||
|
|
||
| This guide explains how to update HyperFleet component chart versions for deployments. | ||
|
|
||
| ## Overview | ||
|
|
||
| HyperFleet component charts (API, Sentinel, Adapter) are published as OCI artifacts to Quay on every merge to main in their respective repos. This infrastructure repo consumes those charts from: | ||
|
|
||
| ``` | ||
| oci://quay.io/redhat-services-prod/hyperfleet-tenant/hyperfleet/ | ||
| ``` | ||
|
|
||
| ## Chart Version Variables | ||
|
|
||
| Three environment variables control which chart versions are deployed: | ||
|
|
||
| | Variable | Default | Component | | ||
| |----------|---------|-----------| | ||
| | `API_CHART_VERSION` | `` (empty) | hyperfleet-api-chart | | ||
| | `SENTINEL_CHART_VERSION` | `` (empty) | hyperfleet-sentinel-chart | | ||
| | `ADAPTER_CHART_VERSION` | `` (empty) | hyperfleet-adapter-chart | | ||
|
|
||
|
|
||
| These are defined in `helmfile/helmfile.yaml.gotmpl` and can be overridden via environment variables or `env.gcp`/`env.kind`. | ||
|
|
||
| **Default Behavior (empty/unset)**: By default, the version is empty, which tells Helm to pull the latest semantic version available in the OCI registry. This maintains the same "always up-to-date" behavior as the previous helm-git setup with `ref=main`. Helm automatically selects the highest SemVer tag. | ||
|
|
||
| **Pinning to a Specific Version**: For production deployments or when you need to test a specific chart version, set the variable to a SemVer version like `0.3.1`. | ||
| ## Listing Available Versions | ||
|
|
||
| ### Via Quay UI | ||
|
|
||
| Browse to: | ||
| - https://quay.io/repository/redhat-services-prod/hyperfleet-tenant/hyperfleet/hyperfleet-api-chart?tab=tags | ||
| - https://quay.io/repository/redhat-services-prod/hyperfleet-tenant/hyperfleet/hyperfleet-sentinel-chart?tab=tags | ||
| - https://quay.io/repository/redhat-services-prod/hyperfleet-tenant/hyperfleet/hyperfleet-adapter-chart?tab=tags | ||
|
|
||
| ### Via CLI | ||
|
|
||
| ```bash | ||
| # List all tags for a chart | ||
| skopeo list-tags docker://quay.io/redhat-services-prod/hyperfleet-tenant/hyperfleet/hyperfleet-api-chart | ||
|
|
||
| # List recent tags (last 10) | ||
| skopeo list-tags docker://quay.io/redhat-services-prod/hyperfleet-tenant/hyperfleet/hyperfleet-api-chart | jq -r '.Tags[]' | sort -V | tail -10 | ||
| ``` | ||
|
|
||
| ## Bumping Versions | ||
|
|
||
| ### Option 1: Override via CLI (temporary, one-time) | ||
|
|
||
| ```bash | ||
| # Upgrade all three charts to 0.3.2 | ||
| API_CHART_VERSION=0.3.2 \ | ||
| SENTINEL_CHART_VERSION=0.3.2 \ | ||
| ADAPTER_CHART_VERSION=0.3.2 \ | ||
| make install-hyperfleet | ||
| ``` | ||
|
|
||
| ### Option 2: Update env.gcp or env.kind (persistent for local dev) | ||
|
|
||
| Edit `env.gcp` or `env.kind`: | ||
|
|
||
| ```bash | ||
| # Add or update these lines | ||
| export API_CHART_VERSION=0.3.2 | ||
| export SENTINEL_CHART_VERSION=0.3.2 | ||
| export ADAPTER_CHART_VERSION=0.3.2 | ||
| ``` | ||
|
|
||
| Then deploy normally: | ||
|
|
||
| ```bash | ||
| make install-hyperfleet | ||
| ``` | ||
|
|
||
| ### Option 3: Update helmfile defaults (permanent, affects all users) | ||
|
|
||
| Edit `helmfile/helmfile.yaml.gotmpl`: | ||
|
|
||
| ```yaml | ||
| values: | ||
| - charts: | ||
| api: | ||
| version: {{ env "API_CHART_VERSION" | default "0.3.2" }} | ||
| sentinel: | ||
| version: {{ env "SENTINEL_CHART_VERSION" | default "0.3.2" }} | ||
| adapter: | ||
| version: {{ env "ADAPTER_CHART_VERSION" | default "0.3.2" }} | ||
| ``` | ||
|
|
||
| Commit and create a PR. After merge, all users get the new defaults. | ||
|
|
||
| ## Upgrade Strategy | ||
|
|
||
| ### Coordinated Release (recommended) | ||
|
|
||
| When all three component repos publish the same version: | ||
|
|
||
| ```bash | ||
| # Single version bump for all charts | ||
| export CHART_VERSION=0.3.2 | ||
| API_CHART_VERSION=$CHART_VERSION \ | ||
| SENTINEL_CHART_VERSION=$CHART_VERSION \ | ||
| ADAPTER_CHART_VERSION=$CHART_VERSION \ | ||
| make install-hyperfleet | ||
| ``` | ||
|
|
||
| ### Independent Versioning | ||
|
|
||
| When components have different versions (e.g., hotfix for API only): | ||
|
|
||
| ```bash | ||
| # Bump only API chart | ||
| API_CHART_VERSION=0.3.2 make install-api | ||
|
|
||
| # Or bump all with different versions | ||
| API_CHART_VERSION=0.3.2 \ | ||
| SENTINEL_CHART_VERSION=0.3.1 \ | ||
| ADAPTER_CHART_VERSION=0.3.1 \ | ||
| make install-hyperfleet | ||
| ``` | ||
|
|
||
| ## Verification | ||
|
|
||
| After deploying with new chart versions: | ||
|
|
||
| ```bash | ||
| # Check deployed chart versions | ||
| helm list -n hyperfleet | ||
|
|
||
| # Inspect a specific release | ||
| helm get values hyperfleet-api -n hyperfleet | ||
|
|
||
| # Verify chart metadata | ||
| helm get metadata hyperfleet-api -n hyperfleet | ||
| ``` | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### Chart version not found | ||
|
|
||
| ``` | ||
| Error: failed to download "hyperfleet-charts/hyperfleet-api-chart" at version "0.3.2" | ||
| ``` | ||
|
|
||
| **Cause:** The requested chart version doesn't exist on Quay. | ||
|
|
||
| **Fix:** Verify the version exists using `skopeo list-tags` or the Quay UI. Check that the component repo's pipeline successfully published the chart. | ||
|
Comment on lines
+139
to
+145
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Replace the removed Git chart reference. Line [140] still uses Use the exact OCI reference selected after registry-path verification. As per path instructions, flag broken user-facing documentation. 🧰 Tools🪛 markdownlint-cli2 (0.23.2)[warning] 139-139: Fenced code blocks should have a language specified (MD040, fenced-code-language) 🤖 Prompt for AI AgentsSource: Path instructions |
||
|
|
||
| ### Permission denied pulling chart | ||
|
|
||
| ``` | ||
| Error: GET "https://quay.io/v2/...": response status code 401: unauthorized | ||
| ``` | ||
|
|
||
| **Cause:** Quay repository is private or you're not authenticated. | ||
|
|
||
| **Fix:** Charts should be public. If private, authenticate: | ||
|
|
||
| ```bash | ||
| helm registry login quay.io -u <username> | ||
| ``` | ||
|
|
||
| ### Helm says "improper constraint" | ||
|
|
||
| ``` | ||
| Error: improper constraint: 0.1.515_aff8821 | ||
| ``` | ||
|
|
||
| **Cause:** Invalid version format. Helm expects SemVer (0.3.1), not commit-suffixed tags (0.1.515_aff8821). | ||
|
|
||
| **Fix:** Use the SemVer tag (0.3.1), not build metadata tags. | ||
|
|
||
| ## Rollback | ||
|
|
||
| To rollback to a previous chart version: | ||
|
|
||
| ```bash | ||
| # Rollback API to 0.3.0 | ||
| API_CHART_VERSION=0.3.0 make install-api | ||
|
|
||
| # Or rollback via helm directly | ||
| helm rollback hyperfleet-api -n hyperfleet | ||
|
Comment on lines
+171
to
+180
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- target document ---'
sed -n '1,220p' docs/bump-chart-versions.md
printf '%s\n' '--- Helm declarations and rollback references ---'
rg -n -i 'helm|helmfile|helmVersion|rollback|API_CHART_VERSION' \
--glob '!vendor/**' --glob '!node_modules/**' . | head -n 240Repository: openshift-hyperfleet/hyperfleet-infra Length of output: 28297 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- declared Helm/toolchain references ---'
rg -n -i 'helm|helm version|helmVersion|rollback' \
--glob '!vendor/**' --glob '!node_modules/**' . | head -n 240Repository: openshift-hyperfleet/architecture Length of output: 41107 🏁 Script executed (no clone): Length of output: 46788 🏁 Script executed: #!/bin/bash
set -eu
sed -n '165,185p' docs/bump-chart-versions.md
rg -n -i 'helm|helmVersion|rollback' \
--glob '!vendor/**' --glob '!node_modules/**' . | head -n 240Repository: openshift-hyperfleet/hyperfleet-infra Length of output: 22395 🏁 Script executed: #!/bin/bash
set -eu
rg -n -i 'helm|helm version|helmVersion|rollback' \
--glob '!vendor/**' --glob '!node_modules/**' . | head -n 240Repository: openshift-hyperfleet/architecture Length of output: 43833 🏁 Script executed (no clone): Length of output: 46752 🏁 Script executed: #!/bin/bash
set -eu
python3 - <<'PY'
from pathlib import Path
doc = Path("docs/bump-chart-versions.md").read_text()
makefile = Path("Makefile").read_text()
helmfile = Path("helmfile/helmfile.yaml.gotmpl").read_text()
assert "API_CHART_VERSION=0.3.0 make install-api" in doc
assert "helm rollback hyperfleet-api -n hyperfleet" in doc
assert "install-api:" in makefile
assert "helmfile apply -f helmfile/helmfile.yaml.gotmpl" in makefile
assert 'version: {{ env "API_CHART_VERSION"' in helmfile
print("install-api invokes helmfile apply and the API chart version is supplied through API_CHART_VERSION")
print("helm rollback is a separate direct Helm command")
PYRepository: openshift-hyperfleet/hyperfleet-infra Length of output: 322 Document chart-version rollback separately from release-revision rollback.
🤖 Prompt for AI AgentsSource: Path instructions |
||
| ``` | ||
|
|
||
| ## Related | ||
|
|
||
| - Chart publishing pipeline: See `.tekton/` in component repos (hyperfleet-api, hyperfleet-sentinel, hyperfleet-adapter) | ||
| - Chart source: `charts/` directory in each component repo | ||
| - Epic: HYPERFLEET-831 (Helm OCI Distribution) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,14 +11,13 @@ helmDefaults: | |
| # Base values for all environments | ||
| values: | ||
| - namespace: {{ requiredEnv "NAMESPACE" }} | ||
| - chartOrg: {{ env "CHART_ORG" | default "openshift-hyperfleet" }} | ||
| - charts: | ||
| api: | ||
| chartRef: {{ env "API_CHART_REF" | default "main" }} | ||
| version: {{ env "API_CHART_VERSION" | default "" }} | ||
| sentinel: | ||
| chartRef: {{ env "SENTINEL_CHART_REF" | default "main" }} | ||
| version: {{ env "SENTINEL_CHART_VERSION" | default "" }} | ||
| adapter: | ||
| chartRef: {{ env "ADAPTER_CHART_REF" | default "main" }} | ||
| version: {{ env "ADAPTER_CHART_VERSION" | default "" }} | ||
|
|
||
| # Environment configurations - e2e, e2e-kind, kind, gcp | ||
| environments: | ||
|
|
@@ -56,13 +55,6 @@ commonLabels: | |
|
|
||
| --- | ||
|
|
||
| repositories: | ||
| - name: hyperfleet-api | ||
| url: git+https://github.com/{{ .Values.chartOrg }}/hyperfleet-api@charts?ref={{ .Values.charts.api.chartRef }}&sparse=0 | ||
| - name: hyperfleet-sentinel | ||
| url: git+https://github.com/{{ .Values.chartOrg }}/hyperfleet-sentinel@charts?ref={{ .Values.charts.sentinel.chartRef }}&sparse=0 | ||
| - name: hyperfleet-adapter | ||
| url: git+https://github.com/{{ .Values.chartOrg }}/hyperfleet-adapter@charts?ref={{ .Values.charts.adapter.chartRef }}&sparse=0 | ||
|
|
||
| releases: | ||
| {{ if eq .Values.brokerType "rabbitmq" }} | ||
|
|
@@ -76,7 +68,10 @@ releases: | |
| # HyperFleet API | ||
| - name: hyperfleet-api | ||
| namespace: {{ .Values.namespace }} | ||
| chart: hyperfleet-api/hyperfleet-api | ||
| chart: oci://quay.io/redhat-services-prod/hyperfleet-tenant/hyperfleet/hyperfleet-api-chart | ||
| {{ if .Values.charts.api.version }} | ||
| version: {{ .Values.charts.api.version }} | ||
|
Comment on lines
+71
to
+72
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win Scope the The changed documentation removes the plugin prerequisite, but
As per path instructions, group repeated cross-file deployment-contract defects at the root cause. 📍 Affects 4 files
🤖 Prompt for AI AgentsSource: Path instructions 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: set -eu
printf '%s\n' '--- helmfile references ---'
sed -n '55,110p' helmfile/helmfile.yaml.gotmpl
printf '%s\n' '--- bump guide references ---'
sed -n '1,55p' docs/bump-chart-versions.md
printf '%s\n' '--- repository history/status ---'
git status --short
git diff --statRepository: openshift-hyperfleet/hyperfleet-infra Length of output: 4002 🏁 Script executed: set -eu
file=$(fd -t f -i 'helm-oci-distribution-design.md' . | head -n 1)
printf 'file=%s\n' "$file"
if [ -n "$file" ]; then
cat -n "$file"
fiRepository: openshift-hyperfleet/architecture Length of output: 13285 Use the flat OCI repository path. The deployment contract defines 📍 Affects 2 files
🤖 Prompt for AI AgentsSources: Path instructions, Linked repositories |
||
| {{ end }} | ||
| labels: | ||
| component: api | ||
| values: | ||
|
|
@@ -85,7 +80,10 @@ releases: | |
| {{ range .Values.sentinels }} | ||
| - name: {{ .name }} | ||
| namespace: {{ $.Values.namespace }} | ||
| chart: hyperfleet-sentinel/hyperfleet-sentinel | ||
| chart: oci://quay.io/redhat-services-prod/hyperfleet-tenant/hyperfleet/hyperfleet-sentinel-chart | ||
| {{ if $.Values.charts.sentinel.version }} | ||
| version: {{ $.Values.charts.sentinel.version }} | ||
| {{ end }} | ||
| needs: | ||
| - hyperfleet-api | ||
| labels: | ||
|
|
@@ -104,7 +102,10 @@ releases: | |
| {{ range .Values.adapters }} | ||
| - name: {{ .name }} | ||
| namespace: {{ $.Values.namespace }} | ||
| chart: hyperfleet-adapter/hyperfleet-adapter | ||
| chart: oci://quay.io/redhat-services-prod/hyperfleet-tenant/hyperfleet/hyperfleet-adapter-chart | ||
| {{ if $.Values.charts.adapter.version }} | ||
| version: {{ $.Values.charts.adapter.version }} | ||
| {{ end }} | ||
| labels: | ||
| component: adapter | ||
| values: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Use the active deployment namespace.
The commands hardcode
hyperfleet.helmfile/helmfile.yaml.gotmplrequiresNAMESPACE, andREADME.mddocuments other values such ashyperfleet-localand e2e namespaces. These commands can inspect or roll back the wrong release.Use
-n "$NAMESPACE"after sourcing the active environment file.As per path instructions, validate cross-file deployment contracts and prioritize operational correctness over formatting.
Also applies to: 175-180
🤖 Prompt for AI Agents
Source: Path instructions