Resolved

FluxCD reconciliation failure due to deprecated HelmRelease API version

FluxCD
Kubernetes
Helm
API Migration
DevOps

Kubernetes cluster rejected HelmRelease manifests using the deprecated `v2beta1` API, causing FluxCD reconciliation failures. The issue was resolved by migrating to the stable `v2` API.

Issue

FluxCD reconciliation failed with the error helm.toolkit.fluxcd.io/v2beta1: the server could not find the requested resource. This occurred because the Kubernetes cluster’s API server no longer supported the deprecated v2beta1 API version, which was used in HelmRelease manifests. The failure blocked FluxCD from processing Helm chart deployments, impacting CI/CD pipelines and infrastructure updates.

Culprit

The root cause was the use of the deprecated v2beta1 API version in HelmRelease manifests, which was removed in Kubernetes following its deprecation policy. The stable v2 API became available in Flux v2.3.0, but the cluster’s HelmRelease resources still referenced the older version. This resulted in API server errors during reconciliation, as the cluster no longer served the v2beta1 API group.

Solution

API Migration

Updated the HelmRelease manifests to use the stable v2 API version instead of the deprecated v2beta1. The migration involved:

  1. Backward Compatibility: The v2 API maintains the same structure as v2beta1, ensuring no breaking changes.
  2. New Features: Access to features like spec.disableValidation and spec.adoptExisting in the v2 API.
  3. Verification: Confirmed successful reconciliation using FluxCD and Kubernetes CLI commands.

Files Updated

  • Replaced apiVersion: helm.toolkit.fluxcd.io/v2beta1 with apiVersion: helm.toolkit.fluxcd.io/v2 in HelmRelease manifests.

Expected Outcome

The migration resolved the reconciliation failures, allowing FluxCD to process Helm chart deployments successfully. The Kubernetes cluster now fully supports the stable v2 API, ensuring compatibility with the latest FluxCD version.

This solution ensures seamless integration with the cluster’s API server and maintains alignment with the latest FluxCD features.