|
| 1 | +# Contributing Guide |
| 2 | + |
| 3 | +This guide explains how to add new charts and release updates. |
| 4 | + |
| 5 | +## Adding a New Chart |
| 6 | + |
| 7 | +### 1. Create the chart structure |
| 8 | + |
| 9 | +```bash |
| 10 | +mkdir -p charts/<chart-name>/templates |
| 11 | +``` |
| 12 | + |
| 13 | +### 2. Required files |
| 14 | + |
| 15 | +``` |
| 16 | +charts/<chart-name>/ |
| 17 | +├── Chart.yaml # Chart metadata (name, version, description) |
| 18 | +├── values.yaml # Default configuration values |
| 19 | +├── README.md # Chart documentation |
| 20 | +├── .helmignore # Files to exclude from package |
| 21 | +└── templates/ # Kubernetes manifest templates |
| 22 | +``` |
| 23 | + |
| 24 | +### 3. Chart.yaml example |
| 25 | + |
| 26 | +```yaml |
| 27 | +apiVersion: v2 |
| 28 | +name: my-chart |
| 29 | +description: Short description of what this chart deploys |
| 30 | +type: application |
| 31 | +version: 0.1.0 |
| 32 | +appVersion: "1.0.0" |
| 33 | +``` |
| 34 | +
|
| 35 | +### 4. Validate your chart |
| 36 | +
|
| 37 | +```bash |
| 38 | +# Lint |
| 39 | +helm lint charts/<chart-name> |
| 40 | + |
| 41 | +# Test template rendering |
| 42 | +helm template my-release charts/<chart-name> |
| 43 | + |
| 44 | +# Test with custom values |
| 45 | +helm template my-release charts/<chart-name> -f custom-values.yaml |
| 46 | +``` |
| 47 | + |
| 48 | +### 5. Document your chart |
| 49 | + |
| 50 | +Create `charts/<chart-name>/README.md` with: |
| 51 | +- Description |
| 52 | +- Prerequisites |
| 53 | +- Installation command |
| 54 | +- Configuration table (parameters, descriptions, defaults) |
| 55 | +- Usage examples |
| 56 | + |
| 57 | +### 6. Update root README |
| 58 | + |
| 59 | +Add your chart to the table in `README.md`: |
| 60 | + |
| 61 | +```markdown |
| 62 | +| [my-chart](./charts/my-chart) | Short description | |
| 63 | +``` |
| 64 | + |
| 65 | +### 7. Submit a Pull Request |
| 66 | + |
| 67 | +```bash |
| 68 | +git checkout -b add-my-chart |
| 69 | +git add charts/<chart-name> README.md |
| 70 | +git commit -m "Add my-chart" |
| 71 | +git push origin add-my-chart |
| 72 | +``` |
| 73 | + |
| 74 | +Open a PR against `main`. The CI pipeline will automatically lint and validate your chart. |
| 75 | + |
| 76 | +## Releasing a Chart |
| 77 | + |
| 78 | +### 1. Update the version |
| 79 | + |
| 80 | +Edit `charts/<chart-name>/Chart.yaml`: |
| 81 | + |
| 82 | +```yaml |
| 83 | +version: 0.2.0 # Bump this |
| 84 | +``` |
| 85 | +
|
| 86 | +### 2. Commit and push |
| 87 | +
|
| 88 | +```bash |
| 89 | +git add charts/<chart-name>/Chart.yaml |
| 90 | +git commit -m "Bump <chart-name> to 0.2.0" |
| 91 | +git push origin main |
| 92 | +``` |
| 93 | + |
| 94 | +### 3. Create and push the tag |
| 95 | + |
| 96 | +The tag format is `<chart-name>-<version>`: |
| 97 | + |
| 98 | +```bash |
| 99 | +git tag <chart-name>-0.2.0 |
| 100 | +git push origin <chart-name>-0.2.0 |
| 101 | +``` |
| 102 | + |
| 103 | +### 4. Verify the release |
| 104 | + |
| 105 | +The release workflow will: |
| 106 | +1. Validate the tag version matches `Chart.yaml` |
| 107 | +2. Lint and package the chart |
| 108 | +3. Push to GitHub Container Registry |
| 109 | + |
| 110 | +Check the workflow status at: https://github.com/helmcode/helm-charts/actions |
| 111 | + |
| 112 | +Once complete, the chart is available at: |
| 113 | +``` |
| 114 | +oci://ghcr.io/helmcode/helm-charts/<chart-name> |
| 115 | +``` |
| 116 | + |
| 117 | +## Versioning Rules |
| 118 | + |
| 119 | +- **Single source of truth**: Version is defined ONLY in `Chart.yaml` |
| 120 | +- **Semantic versioning**: Use `MAJOR.MINOR.PATCH` |
| 121 | + - MAJOR: Breaking changes |
| 122 | + - MINOR: New features (backwards compatible) |
| 123 | + - PATCH: Bug fixes |
| 124 | +- **Tag must match**: The release pipeline validates that tag version equals `Chart.yaml` version |
| 125 | + |
| 126 | +## Code Standards |
| 127 | + |
| 128 | +- All code, comments, and documentation in English |
| 129 | +- Follow [Helm best practices](https://helm.sh/docs/chart_best_practices/) |
| 130 | +- Include meaningful defaults in `values.yaml` |
| 131 | +- Document all configurable parameters |
0 commit comments