|
| 1 | +# Steps to Create a Helm Chart Repository |
| 2 | +> To convert your existing Helm chart directory into a repository that can be used as a Helm chart repo (so others can install it via helm repo add and helm install) |
| 3 | +
|
| 4 | +--- |
| 5 | + |
| 6 | +## 1. Package your Helm chart |
| 7 | + |
| 8 | +Navigate to your chart directory and use `helm package`: |
| 9 | + |
| 10 | +```bash |
| 11 | +cd helm/distributed-job-scheduler-operator |
| 12 | +helm package . |
| 13 | +``` |
| 14 | +This creates a `.tgz` file (e.g., `distributed-job-scheduler-operator-<version>.tgz`). |
| 15 | + |
| 16 | +--- |
| 17 | + |
| 18 | +## 2. Move the chart package to a charts directory (optional but recommended) |
| 19 | + |
| 20 | +Create a `charts` directory at the root of your repo and move the `.tgz` file there: |
| 21 | + |
| 22 | +```bash |
| 23 | +mkdir -p ../../charts |
| 24 | +mv distributed-job-scheduler-operator-*.tgz ../../charts/ |
| 25 | +cd ../../charts |
| 26 | +``` |
| 27 | + |
| 28 | +--- |
| 29 | + |
| 30 | +## 3. Generate an index.yaml for your chart repo |
| 31 | + |
| 32 | +Use the `helm repo index` command to generate or update the Helm repository index file: |
| 33 | + |
| 34 | +```bash |
| 35 | +helm repo index . --url https://github.com/vishalanarase/openinnovationai/releases/latest/download |
| 36 | +``` |
| 37 | + |
| 38 | +- If you want to serve from the `main` branch via GitHub Pages, use: |
| 39 | + ``` |
| 40 | + helm repo index . --url https://vishalanarase.github.io/openinnovationai/charts |
| 41 | + ``` |
| 42 | + |
| 43 | +--- |
| 44 | + |
| 45 | +## 4. Push the `charts/` directory (containing `.tgz` and `index.yaml`) to your GitHub repository |
| 46 | + |
| 47 | +Add, commit, and push: |
| 48 | + |
| 49 | +```bash |
| 50 | +git add charts/ |
| 51 | +git commit -m "Add packaged helm chart and repo index" |
| 52 | +git push |
| 53 | +``` |
| 54 | + |
| 55 | +--- |
| 56 | + |
| 57 | +## 5. (Recommended) Serve your chart via GitHub Pages |
| 58 | + |
| 59 | +- Go to your repo’s settings. |
| 60 | +- Under "Pages", set the source to the `charts/` directory on the `main` branch. |
| 61 | +- Your Helm repo URL will then be: |
| 62 | + `https://vishalanarase.github.io/openinnovationai/charts` |
| 63 | + |
| 64 | +--- |
| 65 | + |
| 66 | +## 6. Add your Helm repo and install the chart |
| 67 | + |
| 68 | +On any machine: |
| 69 | + |
| 70 | +```bash |
| 71 | +helm repo add openinnovationai https://vishalanarase.github.io/openinnovationai/charts |
| 72 | +helm repo update |
| 73 | +helm search repo openinnovationai |
| 74 | +helm install my-job-scheduler openinnovationai/distributed-job-scheduler-operator |
| 75 | +``` |
| 76 | + |
| 77 | +--- |
| 78 | + |
| 79 | +### **Summary** |
| 80 | + |
| 81 | +- Package your chart (`helm package .`) |
| 82 | +- Create `charts/`, move package there |
| 83 | +- Generate `index.yaml` (`helm repo index . --url ...`) |
| 84 | +- Push to GitHub, enable Pages if desired |
| 85 | +- Add repo with `helm repo add ...`, then install |
| 86 | + |
| 87 | +--- |
0 commit comments