Skip to content

Commit 13ce09f

Browse files
Copilotoilbeater
andcommitted
Add OCI registry support for Helm charts (#5837)
* Initial plan * Add OCI registry support for Helm charts to ghcr.io Co-authored-by: oilbeater <[email protected]> * Update Helm chart documentation with OCI registry usage Co-authored-by: oilbeater <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: oilbeater <[email protected]> (cherry picked from commit cf2bd00)
1 parent 77b60b9 commit 13ce09f

File tree

4 files changed

+67
-0
lines changed

4 files changed

+67
-0
lines changed

.github/workflows/release-chart.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
release:
1111
permissions:
1212
contents: write # to push chart release and create a release (helm/chart-releaser-action)
13+
packages: write # to push chart to GitHub Container Registry (ghcr.io)
1314

1415
runs-on: ubuntu-latest
1516
steps:
@@ -30,3 +31,25 @@ jobs:
3031
packages_with_index: true
3132
env:
3233
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
34+
35+
- name: Login to GitHub Container Registry
36+
run: |
37+
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u ${{ github.actor }} --password-stdin
38+
39+
- name: Push charts to OCI registry
40+
run: |
41+
for chart in charts/*/; do
42+
if [ -f "${chart}Chart.yaml" ]; then
43+
chart_name=$(basename "$chart")
44+
chart_version=$(grep '^version:' "${chart}Chart.yaml" | awk '{print $2}' | tr -d 'v')
45+
46+
echo "Packaging and pushing ${chart_name} version ${chart_version}..."
47+
helm package "$chart" -d /tmp/charts
48+
helm push "/tmp/charts/${chart_name}-${chart_version}.tgz" oci://ghcr.io/${{ github.repository_owner }}/charts
49+
fi
50+
done
51+
52+
- name: Logout from GitHub Container Registry
53+
if: always()
54+
run: |
55+
helm registry logout ghcr.io

charts/kube-ovn-v2/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,22 @@
55
This is the v2 of the Helm Chart, replacing the first version in the long term.
66
Make sure to adjust your old values with the new ones and pre-generate your templates with a dry-run to ensure no breaking change occurs.
77

8+
## Installing the Chart
9+
10+
### From OCI Registry
11+
12+
The Helm chart is available from GitHub Container Registry:
13+
14+
```bash
15+
helm install kube-ovn oci://ghcr.io/kubeovn/charts/kube-ovn-v2 --version 1.15.0
16+
```
17+
18+
### From Source
19+
20+
```bash
21+
helm install kube-ovn ./charts/kube-ovn-v2
22+
```
23+
824
## How to install Kube-OVN on Talos Linux
925

1026
To install Kube-OVN on Talos Linux, declare the **OpenvSwitch** module in the `machine` config of your Talos install:

charts/kube-ovn-v2/README.md.gotmpl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,22 @@
55
This is the v2 of the Helm Chart, replacing the first version in the long term.
66
Make sure to adjust your old values with the new ones and pre-generate your templates with a dry-run to ensure no breaking change occurs.
77

8+
## Installing the Chart
9+
10+
### From OCI Registry
11+
12+
The Helm chart is available from GitHub Container Registry:
13+
14+
```bash
15+
helm install kube-ovn oci://ghcr.io/kubeovn/charts/kube-ovn-v2 --version {{ template "chart.version" . }}
16+
```
17+
18+
### From Source
19+
20+
```bash
21+
helm install kube-ovn ./charts/kube-ovn-v2
22+
```
23+
824
## How to install Kube-OVN on Talos Linux
925

1026
To install Kube-OVN on Talos Linux, declare the **OpenvSwitch** module in the `machine` config of your Talos install:

charts/kube-ovn/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
Currently supported version: 1.9
44

5+
## Installing the Chart
6+
7+
### From OCI Registry
8+
9+
The Helm chart is available from GitHub Container Registry:
10+
11+
```bash
12+
helm install kube-ovn oci://ghcr.io/kubeovn/charts/kube-ovn --version v1.15.0
13+
```
14+
15+
### From Source
16+
517
Installation :
618

719
```bash

0 commit comments

Comments
 (0)