This repository provides a Helm chart for a generic OpenShift application and a step-by-step workflow to publish the chart as a Helm repository using GitHub Pages and deploy multiple applications using Argo CD ApplicationSet.
Checklist
docs/)docs/ from main)Overview This README shows how to:
ApplicationSet to deploy multiple applications that share the same chart (or different charts) and different values or sources.Prerequisites
owner/repo (this repo); permission to push and enable Pages1) Publish the Helm chart to GitHub Pages (docs/) 1.1 Package the chart (run from the chart directory):
cd generic-application-helm-chart-openshift
helm package . -d ../docs
1.2 Create or update the repository index pointing to the GitHub Pages URL (replace <owner> and <repo>):
# from repo root, put the index in docs/ and point to your GitHub Pages URL
helm repo index docs --url https://<owner>.github.io/<repo>
1.3 Ensure docs/ contains:
openshift-application-<version>.tgzindex.yaml.nojekyll (optional but recommended)1.4 Commit and push docs/ and enable GitHub Pages to serve docs/ from the main branch.
2) Add the Helm repo locally and validate
helm repo add mycharts https://<owner>.github.io/<repo>
helm repo update
helm search repo mycharts/openshift-application --versions
helm pull mycharts/openshift-application --version 0.1.0
3) Deploy multiple apps with Argo CD ApplicationSet
Why ApplicationSet?
ApplicationSet lets you generate multiple Argo Application resources from a single template and a generator. Using the list generator (or other generators like git, matrix, and clusters), you can create a set of Applications that deploy the same Helm chart with different values or deploy different charts from different sources.
3.1 Example: multiple applications from a Helm repo
Below is an example ApplicationSet that creates multiple Applications from the hosted Helm repo. Each element in the list generator provides per-application parameters (name, target namespace, chart version, etc.). The template uses those parameters to render an Argo Application that installs the Helm chart into a specific namespace.
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: openshift-apps-set
namespace: openshift-gitops
spec:
generators:
- list:
elements:
- name: app-alpha
namespace: app-alpha
chartVersion: "0.1.0"
repoURL: https://<owner>.github.io/<repo>
chart: openshift-application
values:
name: app-alpha
replicaCount: 2
- name: app-beta
namespace: app-beta
chartVersion: "0.1.0"
repoURL: https://<owner>.github.io/<repo>
chart: openshift-application
values:
name: app-beta
replicaCount: 1
template:
metadata:
name: '-application'
spec:
project: default
source:
repoURL: ''
chart: ''
targetRevision: ''
helm:
values: |
# inline values block rendered per element
name:
replicaCount:
destination:
server: https://kubernetes.default.svc
namespace: ''
syncPolicy:
automated:
prune: true
selfHeal: true
Notes on values in the template
helm.values field in the template above is an inline YAML block. It allows you to set or override Helm chart values per generated Application. Alternatively, if your values are stored in Git you can use source.repoURL pointing to the Git repo and path to the value files.3.2 Example: multiple sources (Git + Helm repo) You can mix generators and elements that point to different sources. For example, use some elements whose source is a Helm repo and others whose source is a Git repo that contains a values file or a sub-chart.
Example element using a Git repo for values:
# element example (inside list)
- name: app-git-values
namespace: app-git
repoURL: https://github.com/your-org/your-values-repo.git
path: charts/overrides
chart: openshift-application
chartVersion: 0.1.0
In that case the template.spec.source would use repoURL and path for Git, and the chart would reference the hosted Helm chart (or you can include the chart package directly in that Git repo).
4) Useful workflows & tips
values/ directory in a centralized repo (or per-application folder) so you can reference path in the Application source and use valueFiles in Argo to load those per-app overrides.docs/index.yaml so tooling that expects full URLs works reliably.selfHeal and prune with caution in production; they make Argo automatically correct drift and delete resources that are no longer in Git.syncPolicy.automated.allowEmpty if some apps occasionally have no resources and you want Argo to continue without error.5) Example end-to-end commands
# package and index (from repo root)
cd generic-application-helm-chart-openshift
helm package . -d ../docs
helm repo index ../docs --url https://<owner>.github.io/<repo>
# commit & push
git add docs
git commit -m "Publish helm chart to docs for GitHub Pages"
git push origin main
# add repo locally and verify
helm repo add samplechart https://<owner>.github.io/<repo>
helm repo update
helm search repo samplechart/openshift-application --versions
6) Troubleshooting
helm repo add returns 404 for /index.yaml:
docs/ and pushed to main.main → /docs.index.yaml urls: entries point to accessible .tgz files (absolute URLs are safest for Pages).7) Where to go from here
docs/index.yaml, and push changes — a workflow template is included in this repo).git, list, matrix, clusters).If you’d like, I can:
docs/index.yaml with the exact GitHub Pages URL for your repo and commit it, orApplicationSet YAML for the exact app names and namespaces you want to deploy, orhelm repo add step-by-step interactively.