Q: Your organization operates a monolithic repository containing 50 shared and application Helm charts. Developers regularly commit changes to multiple charts in single PRs. Previously, manual chart packaging led to duplicate version tags, broken dependency subcharts (`charts/`), and overwritten releases. You must design an automated CI/CD pipeline using `chart-testing` (CT) and Helm OCI packaging that detects modified charts, lints templates against schema definitions, enforces semantic version bumps, and pushes versioned OCI artifacts to your registry.
Design an automated Helm chart release pipeline within a monorepo containing 50+ microservice charts using Helm Chart Releaser (CT), Semantic Versioning, and OCI-based registries like Harbor or GHCR.
Want to master this scenario in a live sandbox? KodeKloud's Enterprise GitOps with ArgoCD & Kubernetes Rollouts covers this exact problem with hands-on terminal drills.
🛠️ Production Runbook & Step-by-Step Resolution
Structure the Monorepo with Dependency Subcharts
Establish a clean monorepo hierarchy separating library charts from application charts. Define explicit dependency references in `Chart.yaml` using OCI registry URLs.
helm-charts/
├── .github/workflows/helm-release.yml
├── ct.yaml
├── charts/
│ ├── common-library/ # Library chart containing shared templates
│ │ ├── Chart.yaml
│ │ └── templates/
│ ├── auth-service/
│ │ ├── Chart.yaml
│ │ └── values.yaml
│ └── billing-service/
│ ├── Chart.yaml
│ └── values.yaml
Configure Chart Testing (CT) for Intelligent Diff Detection
Create `ct.yaml` to specify target branches, linting rules, and version increment enforcement. CT uses `git diff` against `main` to identify modified charts, preventing unnecessary re-testing of untouched services.
# ct.yaml
remote: origin
target-branch: main
chart-dirs:
- charts
chart-repos: []
helm-extra-args: --timeout 600s
validate-chart-schema: true
validate-maintainers: false
check-version-increment: true
Implement GitHub Actions PR Verification Pipeline
Run `ct lint` and `ct install` inside ephemeral Kind (Kubernetes in Docker) clusters on every PR to catch template errors and broken values schemas before merge.
name: Lint and Test Charts
on: [pull_request]
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: azure/setup-helm@v4
- uses: helm/chart-testing-action@v2
- name: Run Chart Lint
run: ct lint --config ct.yaml
- name: Create Kind Cluster
uses: helm/kind-action@v1
- name: Run Chart Install Test
run: ct install --config ct.yaml
Publish Helm Charts as OCI Artifacts to Container Registry
Upon merge to `main`, package modified charts and push them directly to GitHub Packages or Harbor using native Helm OCI commands (`helm package` and `helm push`).
- name: Publish OCI Charts
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u ${{ github.actor }} --password-stdin
for chart in charts/*; do
if [ -d "$chart" ]; then
helm dependency build "$chart"
PACKAGE=$(helm package "$chart" | awk '{print $NF}')
helm push "$PACKAGE" oci://ghcr.io/myorg/helm-charts
fi
done
- W
- e
- c
- e
- n
- t
- r
- a
- l
- i
- z
- e
- d
- 5
- 0
- +
- H
- e
- l
- m
- c
- h
- a
- r
- t
- s
- i
- n
- t
- o
- a
- n
- a
- u
- t
- o
- m
- a
- t
- e
- d
- m
- o
- n
- o
- r
- e
- p
- o
- p
- i
- p
- e
- l
- i
- n
- e
- u
- s
- i
- n
- g
- C
- h
- a
- r
- t
- T
- e
- s
- t
- i
- n
- g
- (
- C
- T
- )
- a
- n
- d
- K
- i
- n
- d
- .
- O
- n
- e
- v
- e
- r
- y
- P
- R
- ,
- C
- T
- l
- i
- n
- t
- s
- m
- o
- d
- i
- f
- i
- e
- d
- c
- h
- a
- r
- t
- s
- a
- n
- d
- p
- e
- r
- f
- o
- r
- m
- s
- l
- i
- v
- e
- d
- r
- y
- -
- r
- u
- n
- d
- e
- p
- l
- o
- y
- m
- e
- n
- t
- s
- i
- n
- K
- i
- n
- d
- .
- O
- n
- m
- e
- r
- g
- e
- ,
- c
- h
- a
- r
- t
- s
- a
- r
- e
- p
- a
- c
- k
- a
- g
- e
- d
- a
- n
- d
- p
- u
- s
- h
- e
- d
- a
- s
- O
- C
- I
- a
- r
- t
- i
- f
- a
- c
- t
- s
- d
- i
- r
- e
- c
- t
- l
- y
- t
- o
- o
- u
- r
- c
- o
- n
- t
- a
- i
- n
- e
- r
- r
- e
- g
- i
- s
- t
- r
- y
- ,
- e
- l
- i
- m
- i
- n
- a
- t
- i
- n
- g
- c
- u
- s
- t
- o
- m
- H
- e
- l
- m
- r
- e
- p
- o
- i
- n
- d
- e
- x
- s
- y
- n
- c
- h
- r
- o
- n
- i
- z
- a
- t
- i
- o
- n
- i
- s
- s
- u
- e
- s
- .