Skip to content

Commit 9a00507

Browse files
author
Sunil Thaha
committed
ci(release): publish helm charts
Signed-off-by: Sunil Thaha <[email protected]>
1 parent 836b2fd commit 9a00507

File tree

3 files changed

+197
-6
lines changed

3 files changed

+197
-6
lines changed

.github/workflows/release.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ jobs:
3838
VERSION: ${{ github.event.inputs.tag }}
3939
- name: Install all tools
4040
uses: ./.github/tools-cache
41+
- name: Setup Helm
42+
uses: azure/setup-helm@v4
43+
with:
44+
version: latest
4145
- name: Build Operator
4246
run: |
4347
make operator-build
@@ -49,6 +53,21 @@ jobs:
4953
env:
5054
IMG_BASE: ${{ vars.IMG_BASE }}
5155
VERSION_REPLACED: ${{ github.event.inputs.version-replace }}
56+
- name: Update Helm Chart Version
57+
shell: bash
58+
run: |
59+
VERSION=${{ github.event.inputs.tag }}
60+
# Update Chart.yaml with the release version
61+
sed -i "s/^version:.*/version: $VERSION/" manifests/helm/kepler-operator/Chart.yaml
62+
sed -i "s/^appVersion:.*/appVersion: \"v$VERSION\"/" manifests/helm/kepler-operator/Chart.yaml
63+
- name: Package Helm Chart
64+
shell: bash
65+
run: |
66+
mkdir -p helm-releases
67+
VERSION=${{ github.event.inputs.tag }}
68+
helm package manifests/helm/kepler-operator -d helm-releases
69+
# Rename the helm chart to include 'helm' identifier
70+
mv helm-releases/kepler-operator-${VERSION}.tgz helm-releases/kepler-operator-helm-${VERSION}.tgz
5271
- name: Git set user
5372
run: |
5473
git config user.name "$USERNAME"
@@ -106,3 +125,10 @@ jobs:
106125
generate_release_notes: true
107126
draft: false
108127
prerelease: false
128+
files: |
129+
helm-releases/*.tgz
130+
- name: Push Helm Chart to OCI registry
131+
shell: bash
132+
run: |
133+
VERSION=${{ github.event.inputs.tag }}
134+
helm push helm-releases/kepler-operator-helm-${VERSION}.tgz oci://quay.io/sustainable_computing_io/charts

docs/developer/helm-chart-maintenance.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,112 @@ When releasing a new version:
413413

414414
---
415415

416+
## 🚀 Manual Build and Publish
417+
418+
For manual chart publishing (outside of automated release workflow):
419+
420+
### Prerequisites
421+
422+
- Helm >=3.0.0
423+
- Access to Quay.io registry (`BOT_NAME` and `BOT_TOKEN`)
424+
- Chart version updated in `Chart.yaml`
425+
426+
### Build and Publish Process
427+
428+
**1. Update Chart Version**:
429+
430+
```bash
431+
VERSION=0.22.0
432+
433+
# Update Chart.yaml with the release version
434+
sed -i "s/^version:.*/version: $VERSION/" manifests/helm/kepler-operator/Chart.yaml
435+
sed -i "s/^appVersion:.*/appVersion: \"v$VERSION\"/" manifests/helm/kepler-operator/Chart.yaml
436+
437+
# Verify changes
438+
cat manifests/helm/kepler-operator/Chart.yaml
439+
```
440+
441+
**2. Validate Chart**:
442+
443+
```bash
444+
make helm-validate
445+
```
446+
447+
**3. Package Chart**:
448+
449+
```bash
450+
# Create output directory
451+
mkdir -p helm-releases
452+
453+
# Package the chart
454+
helm package manifests/helm/kepler-operator -d helm-releases
455+
456+
# Optional: Rename with -helm- identifier for clarity
457+
mv helm-releases/kepler-operator-${VERSION}.tgz \
458+
helm-releases/kepler-operator-helm-${VERSION}.tgz
459+
```
460+
461+
**4. Login to OCI Registry**:
462+
463+
```bash
464+
# Login to Quay.io
465+
helm registry login quay.io/sustainable_computing_io \
466+
--username "$BOT_NAME" \
467+
--password "$BOT_TOKEN"
468+
```
469+
470+
**5. Push to OCI Registry**:
471+
472+
```bash
473+
# Push to Quay.io OCI registry
474+
helm push helm-releases/kepler-operator-helm-${VERSION}.tgz \
475+
oci://quay.io/sustainable_computing_io/charts
476+
```
477+
478+
**6. Verify Publication**:
479+
480+
```bash
481+
# Pull the chart to verify it's available
482+
helm pull oci://quay.io/sustainable_computing_io/charts/kepler-operator \
483+
--version ${VERSION} \
484+
-d /tmp
485+
486+
# Inspect the downloaded chart
487+
tar -tzf /tmp/kepler-operator-${VERSION}.tgz | head -20
488+
```
489+
490+
### Install from OCI Registry
491+
492+
Users can install the published chart directly from the OCI registry:
493+
494+
```bash
495+
# Install latest version
496+
helm install kepler-operator \
497+
oci://quay.io/sustainable_computing_io/charts/kepler-operator \
498+
--namespace kepler-operator \
499+
--create-namespace
500+
501+
# Install specific version
502+
helm install kepler-operator \
503+
oci://quay.io/sustainable_computing_io/charts/kepler-operator \
504+
--version 0.22.0 \
505+
--namespace kepler-operator \
506+
--create-namespace
507+
```
508+
509+
### Automated Release
510+
511+
The GitHub release workflow (`.github/workflows/release.yaml`) automatically:
512+
513+
1. Updates Chart.yaml version
514+
2. Packages the chart
515+
3. Attaches chart to GitHub release
516+
4. Pushes to OCI registry at `oci://quay.io/sustainable_computing_io/charts`
517+
518+
To trigger automated release, use the workflow dispatch with the desired version tag.
519+
520+
---
521+
416522
## 📚 Additional Resources
417523

418524
- **Helm Best Practices**: <https://helm.sh/docs/chart_best_practices/>

manifests/helm/kepler-operator/README.md

Lines changed: 65 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,38 @@ kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/
2020

2121
### Install Kepler Operator
2222

23-
**From source repository:**
23+
**From OCI registry (recommended for users):**
24+
25+
```bash
26+
# Install latest version
27+
helm install kepler-operator \
28+
oci://quay.io/sustainable_computing_io/charts/kepler-operator \
29+
--namespace kepler-operator \
30+
--create-namespace
31+
32+
# Install specific version
33+
helm install kepler-operator \
34+
oci://quay.io/sustainable_computing_io/charts/kepler-operator \
35+
--version 0.21.0 \
36+
--namespace kepler-operator \
37+
--create-namespace
38+
```
39+
40+
**From source repository (for developers):**
2441

2542
```bash
2643
make helm-install
2744
```
2845

29-
**Using Helm directly:**
46+
**Using Helm directly (local development):**
3047

3148
```bash
3249
helm install kepler-operator ./manifests/helm/kepler-operator \
3350
--namespace kepler-operator \
3451
--create-namespace
3552
```
3653

37-
**From packaged chart:**
54+
**From packaged chart file:**
3855

3956
```bash
4057
helm install kepler-operator kepler-operator-0.21.0.tgz \
@@ -44,19 +61,46 @@ helm install kepler-operator kepler-operator-0.21.0.tgz \
4461

4562
### Install with custom values
4663

64+
**From OCI registry with custom values:**
65+
4766
```bash
48-
helm install kepler-operator ./manifests/helm/kepler-operator \
67+
helm install kepler-operator \
68+
oci://quay.io/sustainable_computing_io/charts/kepler-operator \
4969
--namespace kepler-operator \
5070
--create-namespace \
5171
--set operator.image=quay.io/sustainable_computing_io/kepler-operator:v0.21.0 \
5272
--set kepler.image=quay.io/sustainable_computing_io/kepler:v0.11.0 \
5373
--set metrics.serviceMonitor.enabled=true
5474
```
5575

56-
Or create a custom `values.yaml` and install:
76+
**From local source with custom values:**
5777

5878
```bash
5979
helm install kepler-operator ./manifests/helm/kepler-operator \
80+
--namespace kepler-operator \
81+
--create-namespace \
82+
--set operator.image=quay.io/sustainable_computing_io/kepler-operator:v0.21.0 \
83+
--set kepler.image=quay.io/sustainable_computing_io/kepler:v0.11.0 \
84+
--set metrics.serviceMonitor.enabled=true
85+
```
86+
87+
**Using custom values file:**
88+
89+
```bash
90+
# Create custom-values.yaml
91+
cat > custom-values.yaml <<EOF
92+
operator:
93+
image: quay.io/sustainable_computing_io/kepler-operator:v0.21.0
94+
kepler:
95+
image: quay.io/sustainable_computing_io/kepler:v0.11.0
96+
metrics:
97+
serviceMonitor:
98+
enabled: true
99+
EOF
100+
101+
# Install with custom values
102+
helm install kepler-operator \
103+
oci://quay.io/sustainable_computing_io/charts/kepler-operator \
60104
--namespace kepler-operator \
61105
--create-namespace \
62106
--values custom-values.yaml
@@ -100,13 +144,28 @@ spec:
100144
101145
## Upgrading
102146
147+
**From OCI registry:**
148+
149+
```bash
150+
# Upgrade to latest version
151+
helm upgrade kepler-operator \
152+
oci://quay.io/sustainable_computing_io/charts/kepler-operator \
153+
--namespace kepler-operator
154+
155+
# Upgrade to specific version
156+
helm upgrade kepler-operator \
157+
oci://quay.io/sustainable_computing_io/charts/kepler-operator \
158+
--version 0.22.0 \
159+
--namespace kepler-operator
160+
```
161+
103162
**From source repository:**
104163

105164
```bash
106165
make helm-install # Uses helm upgrade --install
107166
```
108167

109-
**Using Helm directly:**
168+
**Using Helm directly (local development):**
110169

111170
```bash
112171
helm upgrade kepler-operator ./manifests/helm/kepler-operator \

0 commit comments

Comments
 (0)