Middle
How do you version charts in your projects?
sobes.tech AI
Answer from AI
We use semantic versioning (SemVer) in the format MAJOR.MINOR.PATCH.
MAJOR: Changes that break backward compatibility.MINOR: Adding functionality in a backward-compatible manner.PATCH: Bug fixes that are backward-compatible.
The following practices are applied:
- The chart version is specified in the
Chart.yamlfile. - With every change affecting deployment (even minor), the version is increased according to SemVer.
- Git tags are used to record chart versions. The tag corresponds to the chart version (e.g.,
mychart-1.2.3). - When deploying, a specific chart version is used, not the latest.
- Versioning is integrated into the CI/CD pipeline.
Example Chart.yaml:
# Chart.yaml
apiVersion: v2
name: my-app
description: A Helm chart for my application
version: 1.2.3 # Chart version
appVersion: "1.0.0" # Application version
CI/CD Flow:
- Developer makes changes to the chart.
- A Merge Request is opened.
- The CI pipeline performs linting and testing of the chart (
helm lint,helm test). - Upon merging into the main branch, the chart version is increased (either manually or automatically using CI/CD tools).
- A Git tag with the new chart version is created.
- Charts are packaged (
helm package) and published to chart repositories (e.g., Artifactory, Nexus, OCI Registry).
This ensures the ability to roll back to previous versions and clearly defines changes between versions.