✦ For everyone, free.

Practical knowledge for real and everyday life

Home

Chart Compatibility

Chart Compatibility ensures Helm charts work across different Kubernetes versions, enabling reliable deployments through versioned dependencies and semantic versioning.

Chart Compatibility defines the ability of a Helm chart to operate correctly and reliably within specific versions of the Helm client, Kubernetes API, and the Helm chart specification itself. It ensures that charts can be installed, upgraded, and maintained without errors or unexpected behavior due to version mismatches or deprecated features. Chart Compatibility is crucial for maintaining stability and consistency across diverse deployment environments and evolving Kubernetes and Helm ecosystems.


Definition and Scope of Chart Compatibility

Chart Compatibility encompasses multiple dimensions that collectively determine whether a Helm chart can function as intended in a given environment. These include:

  • Helm Version Compatibility: Charts must conform to the Helm version's expected APIs and feature sets. This ensures that the chart's templates, hooks, and metadata are understood and processed correctly by the Helm client.
  • Kubernetes API Compatibility: Since charts deploy resources to Kubernetes clusters, the chart's manifests must use API versions and resource definitions supported by the target Kubernetes cluster. Deprecated or removed Kubernetes APIs in newer cluster versions can cause installation or upgrade failures.
  • Chart API Versioning: Helm charts specify an apiVersion in their Chart.yaml file (e.g., v1, v2) which dictates the chart format version and feature capabilities. Compatibility requires that the Helm client supports the chart API version used.

Chart Compatibility is a fundamental part of Helm chart lifecycle management, guiding authors and operators in chart development, testing, and deployment.


Helm Version Compatibility

Chart API Versions

Helm charts declare their API version explicitly:

  • v1: The original chart format used in Helm 2 and early Helm 3 versions.
  • v2: Introduced with Helm 3, adding new features and changes in chart metadata and structure.

Supporting the declared API version ensures that Helm clients parse and render charts correctly. Helm clients maintain backward compatibility with older chart API versions but may deprecate support for very old formats over time.

Helm Client Features and APIs

Certain chart features rely on Helm client capabilities, such as:

  • Template functions and helpers
  • Chart hooks lifecycle management
  • Built-in objects and values handling

Charts using advanced Helm features require a minimum Helm client version to guarantee compatibility.


Kubernetes API Compatibility in Charts

Kubernetes API Versioning and Deprecations

Kubernetes evolves rapidly, often deprecating or removing API versions for core resources like Deployments, StatefulSets, and Ingresses. For example:

  • extensions/v1beta1 Deployment was deprecated in favor of apps/v1.
  • networking.k8s.io/v1beta1 Ingress was replaced by networking.k8s.io/v1.

Charts must use API versions supported by the Kubernetes cluster where they are deployed. Using deprecated or removed APIs can cause installation failures or runtime errors.

Resource Schema and Field Changes

Beyond API versioning, Kubernetes resource schemas may change, adding or removing fields or altering defaults. Charts must be tested against target Kubernetes versions to ensure manifest correctness.

Compatibility Matrix

Chart maintainers typically provide a compatibility matrix indicating supported Kubernetes versions and API versions, helping users select appropriate chart versions.


Chart Metadata and Compatibility Annotations

Charts can include metadata to specify compatibility constraints explicitly:

  • kubeVersion: Defines the supported Kubernetes cluster versions using semver ranges (e.g., >=1.16.0-0 <1.25.0-0).
  • appVersion: Indicates the version of the packaged application but indirectly relates to compatibility through feature sets.
  • Annotations and Labels: Additional metadata may specify compatibility or requirements for tooling integration.

These metadata fields help Helm and users validate compatibility prior to deployment.


Testing and Validation of Chart Compatibility

Continuous Integration Practices

Maintaining chart compatibility requires automated testing against multiple Helm client versions and Kubernetes cluster versions. This ensures charts remain functional as Helm and Kubernetes evolve.

Linting and Static Analysis

Helm provides linting tools (helm lint) to detect common chart issues, including compatibility warnings related to API versions or Helm features.

Helm Deprecation Warnings

Helm emits warnings during chart install or upgrade when deprecated or incompatible APIs or features are detected, guiding users to update charts or clients.


Maintaining and Evolving Chart Compatibility

Upgrading Charts for Compatibility

Chart maintainers must periodically update charts to support new Helm and Kubernetes versions by:

  • Migrating manifests to newer Kubernetes API versions.
  • Adapting to Helm chart API changes.
  • Testing against the latest Helm and Kubernetes versions.

Versioning and Release Management

Charts use semantic versioning to communicate compatibility changes. Breaking changes in compatibility typically warrant a major version increment.

Documentation

Clear documentation of compatibility requirements and supported versions is essential for users to select compatible charts and avoid deployment issues.


Chart Compatibility is a multidimensional concept ensuring Helm charts function reliably across Helm client versions and Kubernetes cluster versions by aligning API usage, metadata, and testing practices. It is a critical aspect of Helm chart maintenance, enabling smooth deployments and upgrades in diverse and evolving container orchestration environments.