Using OCI Object Storage as helm chart repo

Ali Mukadam
Oracle Developers
Published in
3 min readAug 14, 2023
Photo by Lia Trevarthen on Unsplash

In my previous article, I needed a helm chart repo that can be publicly accessible and I used GitHub pages. In this article, we’ll use OCI Object to Storage to store our helm charts and serve them publicly.

First, create a bucket:

If you want to make the repo public, edit the visibility:

Next, let’s create a couple of charts:

helm create chart1
helm create chart2

We can now package them:

helm package chart1
Successfully packaged chart and saved it to: /home/opc/chart1-0.1.0.tgz
helm package chart2
Successfully packaged chart and saved it to: /home/opc/chart2-0.1.0.tgz

Make a directory to hold the charts and move the packaged charts into it:

mkdir charts
mv chart1-0.1.0.tgz charts/
mv chart2-0.1.0.tgz charts/

We can now bulk-upload the charts:

cd charts
oci os object bulk-upload --namespace <tenancy namespace> --bucket-name helmcharts --src-dir .

Uploaded chart1-0.1.0.tgz [####################################] 100%
Uploaded chart2-0.1.0.tgz [####################################] 100%

For a bucket with public visibility, the url is usually something like the following:

https://<tenancynamespace>.objectstorage.<region>.oci.customer-oci.com/n/<tenancynamespace>/b/<bucketname>/o/

Object storage urls are long by design and gore my eyes. I want a friendlier one. Let’s use OCI’s HTTP Redirect (you need to have a domain set up). Follow the wizard in OCI console, it’s self-explanatory:

In the target section, set the following:

  • Protocol: HTTPS
  • Host: objectstorage.<region>.oraclecloud.com
  • Port: 443
  • Path: Click on the kebab menu and copy the path including the beginning / and upto but excluding the last / and the chart file and append {path} to it.

As an example, say my object url is https://namespace.objectstorage.us-ashburn-1.oci.customer-oci.com/n/namespace/b/helmcharts/o/chart1–0.1.0.tgz. My path would then be: /n/namespace/b/helmcharts/o{path}.

Once the redirect is created, generate your index.yaml with the friendly url:

helm repo index --url https://<friendlyurl>/

The <friendlyurl> is the combination of domain and zone you used when creating the redirect in the form: domain.zone

Then, upload the generated index.yaml to object storage:

oci os object put -bn helmcharts --file index.yaml -ns <tenancynamespace>

We can now test if our chart repo works. Add the repo:

helm repo add myrepo https://<friendlyurl>/

Update and search the repo:

helm search repo
NAME CHART VERSION APP VERSION DESCRIPTION
os/chart1 0.1.0 1.16.0 A Helm chart for Kubernetes
os/chart2 0.1.0 1.16.0 A Helm chart for Kubernetes

And your helm repo is now online. You can now use it to deploy your charts in OKE or in other Kubernetes clusters provided they can reach the destination, in this case OCI Object Storage.

I hope you find this useful.

--

--