Sobes.tech
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.yaml file.
  • 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:

  1. Developer makes changes to the chart.
  2. A Merge Request is opened.
  3. The CI pipeline performs linting and testing of the chart (helm lint, helm test).
  4. Upon merging into the main branch, the chart version is increased (either manually or automatically using CI/CD tools).
  5. A Git tag with the new chart version is created.
  6. 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.