Skip to content

Commit a0558af

Browse files
barckcodeclaude
andcommitted
Add Helm charts repository structure
- Add rabbitmq chart using RabbitMQ Cluster Operator - Add GitHub Actions workflows for CI and releases - Add documentation (README.md, CLAUDE.md) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 62aa0ae commit a0558af

11 files changed

Lines changed: 464 additions & 0 deletions

File tree

.github/workflows/helm.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Helm Charts
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
REGISTRY: ghcr.io
11+
REGISTRY_PATH: ghcr.io/helmcode/helm-charts
12+
13+
jobs:
14+
lint:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Helm
21+
uses: azure/setup-helm@v4
22+
23+
- name: Lint charts
24+
run: |
25+
for chart in charts/*/; do
26+
if [ -f "$chart/Chart.yaml" ]; then
27+
echo "Linting $chart..."
28+
helm lint "$chart"
29+
fi
30+
done
31+
32+
build:
33+
runs-on: ubuntu-latest
34+
needs: lint
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
39+
- name: Set up Helm
40+
uses: azure/setup-helm@v4
41+
42+
- name: Package charts
43+
run: |
44+
mkdir -p packages
45+
for chart in charts/*/; do
46+
if [ -f "$chart/Chart.yaml" ]; then
47+
echo "Packaging $chart..."
48+
helm package "$chart" -d packages/
49+
fi
50+
done
51+
52+
- name: Upload packages
53+
uses: actions/upload-artifact@v4
54+
with:
55+
name: helm-packages
56+
path: packages/
57+
retention-days: 1
58+
59+
publish:
60+
runs-on: ubuntu-latest
61+
needs: build
62+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
63+
permissions:
64+
contents: read
65+
packages: write
66+
steps:
67+
- name: Download packages
68+
uses: actions/download-artifact@v4
69+
with:
70+
name: helm-packages
71+
path: packages/
72+
73+
- name: Set up Helm
74+
uses: azure/setup-helm@v4
75+
76+
- name: Login to GHCR
77+
run: echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ${{ env.REGISTRY }} -u ${{ github.actor }} --password-stdin
78+
79+
- name: Push charts to GHCR
80+
run: |
81+
for file in packages/*.tgz; do
82+
echo "Pushing $file..."
83+
helm push "$file" oci://${{ env.REGISTRY_PATH }}
84+
done

.github/workflows/release.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Release Chart
2+
3+
on:
4+
push:
5+
tags:
6+
- '*-[0-9]+.[0-9]+.[0-9]+'
7+
8+
env:
9+
REGISTRY: ghcr.io
10+
REGISTRY_PATH: ghcr.io/helmcode/helm-charts
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Extract chart info from tag
23+
id: chart
24+
run: |
25+
TAG="${GITHUB_REF#refs/tags/}"
26+
CHART_NAME="${TAG%-*}"
27+
CHART_VERSION="${TAG##*-}"
28+
echo "name=$CHART_NAME" >> $GITHUB_OUTPUT
29+
echo "version=$CHART_VERSION" >> $GITHUB_OUTPUT
30+
echo "path=charts/$CHART_NAME" >> $GITHUB_OUTPUT
31+
32+
- name: Validate chart exists
33+
run: |
34+
if [ ! -f "${{ steps.chart.outputs.path }}/Chart.yaml" ]; then
35+
echo "Error: Chart '${{ steps.chart.outputs.name }}' not found at ${{ steps.chart.outputs.path }}"
36+
exit 1
37+
fi
38+
39+
- name: Validate version matches
40+
run: |
41+
CHART_VERSION=$(grep '^version:' ${{ steps.chart.outputs.path }}/Chart.yaml | awk '{print $2}')
42+
if [ "$CHART_VERSION" != "${{ steps.chart.outputs.version }}" ]; then
43+
echo "Error: Tag version '${{ steps.chart.outputs.version }}' does not match Chart.yaml version '$CHART_VERSION'"
44+
exit 1
45+
fi
46+
47+
- name: Set up Helm
48+
uses: azure/setup-helm@v4
49+
50+
- name: Lint chart
51+
run: helm lint ${{ steps.chart.outputs.path }}
52+
53+
- name: Login to GHCR
54+
run: echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ${{ env.REGISTRY }} -u ${{ github.actor }} --password-stdin
55+
56+
- name: Package and push chart
57+
run: |
58+
helm package ${{ steps.chart.outputs.path }}
59+
helm push ${{ steps.chart.outputs.name }}-${{ steps.chart.outputs.version }}.tgz oci://${{ env.REGISTRY_PATH }}

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Helm packages
2+
*.tgz
3+
packages/
4+
5+
# OS files
6+
.DS_Store
7+
Thumbs.db
8+
9+
# IDE
10+
.idea/
11+
.vscode/
12+
*.swp
13+
*.swo
14+
*~
15+
16+
# Temporary files
17+
*.tmp
18+
*.bak
19+
*.orig

CLAUDE.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# CLAUDE.md
2+
3+
This file provides context for Claude Code when working on this repository.
4+
5+
## Project Overview
6+
7+
This is a public Helm charts repository maintained by Helmcode. Charts are published as OCI artifacts to GitHub Container Registry (ghcr.io/helmcode/helm-charts).
8+
9+
## Repository Structure
10+
11+
```
12+
helm-charts/
13+
├── .github/workflows/
14+
│ ├── helm.yml # CI pipeline (lint, build, publish on main)
15+
│ └── release.yml # Release pipeline (triggered by version tags)
16+
├── charts/
17+
│ └── <chart-name>/ # Each chart in its own directory
18+
│ ├── Chart.yaml
19+
│ ├── values.yaml
20+
│ ├── README.md # Chart-specific documentation
21+
│ ├── .helmignore
22+
│ └── templates/
23+
├── .gitignore
24+
├── LICENSE # Apache 2.0
25+
├── README.md
26+
└── CLAUDE.md
27+
```
28+
29+
## Development Commands
30+
31+
```bash
32+
# Lint a chart
33+
helm lint charts/<chart-name>
34+
35+
# Package a chart
36+
helm package charts/<chart-name>
37+
38+
# Template a chart (dry-run)
39+
helm template my-release charts/<chart-name>
40+
41+
# Validate chart with custom values
42+
helm template my-release charts/<chart-name> -f custom-values.yaml
43+
```
44+
45+
## CI/CD Pipelines
46+
47+
### helm.yml (Continuous Integration)
48+
Runs on every push and PR to main:
49+
1. **lint**: Validates all charts
50+
2. **build**: Packages charts into `.tgz` artifacts
51+
3. **publish**: Pushes to GHCR (only on main branch)
52+
53+
### release.yml (Release)
54+
Triggered by chart-specific tags using format `<chart-name>-<version>`:
55+
- Extracts chart name and version from tag
56+
- Validates chart exists and version matches `Chart.yaml`
57+
- Lints, packages, and publishes only that chart to GHCR
58+
59+
To release a chart:
60+
```bash
61+
# 1. Update version in charts/<chart-name>/Chart.yaml
62+
# 2. Commit and push changes
63+
# 3. Create and push tag
64+
git tag rabbitmq-0.2.0
65+
git push origin rabbitmq-0.2.0
66+
```
67+
68+
**Important**: The tag version must match the version in `Chart.yaml`.
69+
70+
## Adding a New Chart
71+
72+
1. Create a new directory under `charts/`
73+
2. Include at minimum: `Chart.yaml`, `values.yaml`, `templates/`
74+
3. Add `README.md` with chart documentation (prerequisites, configuration, examples)
75+
4. Add `.helmignore` to exclude unnecessary files
76+
5. Update root `README.md` with the new chart in the table
77+
78+
## Versioning
79+
80+
- **Single source of truth**: Each chart's version is defined ONLY in its `Chart.yaml`
81+
- **No hardcoded versions in docs**: READMEs use `helm install` without `--version` flag
82+
- **Tag format**: `<chart-name>-<semver>` (e.g., `rabbitmq-0.2.0`)
83+
- The release pipeline validates that tag version matches `Chart.yaml`
84+
85+
## Code Standards
86+
87+
- All code, comments, and documentation must be in English
88+
- Follow Helm best practices for chart structure
89+
- Use semantic versioning in `Chart.yaml`
90+
- Include meaningful default values in `values.yaml`

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Helm Charts
2+
3+
A collection of Helm charts maintained by [Helmcode](https://github.com/helmcode).
4+
5+
## Available Charts
6+
7+
| Chart | Description |
8+
|-------|-------------|
9+
| [rabbitmq](./charts/rabbitmq) | RabbitMQ using the RabbitMQ Cluster Operator |
10+
11+
## Usage
12+
13+
Charts are published to GitHub Container Registry (GHCR) as OCI artifacts.
14+
15+
```bash
16+
# Pull a chart
17+
helm pull oci://ghcr.io/helmcode/helm-charts/rabbitmq
18+
19+
# Install directly
20+
helm install my-rabbitmq oci://ghcr.io/helmcode/helm-charts/rabbitmq
21+
```
22+
23+
## Prerequisites
24+
25+
Each chart may have specific prerequisites. For example, the `rabbitmq` chart requires the [RabbitMQ Cluster Operator](https://www.rabbitmq.com/kubernetes/operator/operator-overview) to be installed in your cluster.
26+
27+
## Contributing
28+
29+
1. Fork the repository
30+
2. Create a feature branch
31+
3. Make your changes
32+
4. Submit a pull request
33+
34+
## License
35+
36+
Apache License 2.0 - see [LICENSE](./LICENSE) for details.

charts/rabbitmq/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

charts/rabbitmq/Chart.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: v2
2+
name: rabbitmq
3+
description: RabbitMQ Helm chart using the RabbitMQ Cluster Operator
4+
type: application
5+
6+
version: 0.1.0
7+
appVersion: "1.0.0"

charts/rabbitmq/README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# RabbitMQ Helm Chart
2+
3+
A Helm chart for deploying RabbitMQ using the [RabbitMQ Cluster Operator](https://www.rabbitmq.com/kubernetes/operator/operator-overview).
4+
5+
## Prerequisites
6+
7+
- Kubernetes 1.19+
8+
- Helm 3.0+
9+
- [RabbitMQ Cluster Operator](https://github.com/rabbitmq/cluster-operator) installed in your cluster
10+
11+
### Installing the Operator
12+
13+
```bash
14+
kubectl apply -f https://github.com/rabbitmq/cluster-operator/releases/latest/download/cluster-operator.yml
15+
```
16+
17+
## Installation
18+
19+
```bash
20+
helm install my-rabbitmq oci://ghcr.io/helmcode/helm-charts/rabbitmq
21+
```
22+
23+
## Configuration
24+
25+
| Parameter | Description | Default |
26+
|-----------|-------------|---------|
27+
| `spec.replicas` | Number of RabbitMQ replicas | `3` |
28+
| `spec.image` | RabbitMQ image | `rabbitmq:3.13.7-management` |
29+
| `spec.service.type` | Kubernetes service type | `ClusterIP` |
30+
| `spec.persistence.storageClassName` | Storage class for PVCs | `gp2` |
31+
| `spec.persistence.storage` | Storage size per replica | `10Gi` |
32+
33+
## Example
34+
35+
Custom values file:
36+
37+
```yaml
38+
spec:
39+
replicas: 5
40+
image: rabbitmq:3.13.7-management
41+
service:
42+
type: LoadBalancer
43+
persistence:
44+
storageClassName: standard
45+
storage: 20Gi
46+
```
47+
48+
Install with custom values:
49+
50+
```bash
51+
helm install my-rabbitmq oci://ghcr.io/helmcode/helm-charts/rabbitmq -f values-custom.yaml
52+
```
53+
54+
## Uninstallation
55+
56+
```bash
57+
helm uninstall my-rabbitmq
58+
```

0 commit comments

Comments
 (0)