Move resources from HelmRelease to Kustomization
Revision | Date | Description |
|---|---|---|
| 24.07.2024 | Init Changelog |
Introduction
This article explains how to move resources created with HelmRelease (FluxCD) to Kustomization (also FluxCD) without removing it from cluster.
Requirements
To perform this action you will need:
Access to Kubernetes cluster
Access to FluxCD repository with reposurces
Flux CLI
kubectlHelm 3
Instructions
Follow instructions below:
Suspend
HelmRelease:flux suspend hr <name> -n <namespace>.Remove
HelmReleasedefinition from FluxCD repository.Check if Helm Chart is still deployed on cluster:
helm ls -A.Check
SecretsfromNamespaceyour Helm Chart is deployed and find all resources withtype=helm.sh/release.v1:kubectl get secrets -n <namespace>.Delete all
Secretsfound in step 4 that's name match to:sh.helm.release.v1.<name>.v*- these secrets contains Helm Release information.Check if Helm Chart is still deployed on cluster (it shouldn’t):
helm ls -A.Create and commit YAML manifests for all resources from
HelmReleaseand attach it toKustomizationfor FluxCD.Wait till FluxCD reconcile.
Check if all resources have FluxCD labels (
kustomize.toolkit.fluxcd.io/nameandkustomize.toolkit.fluxcd.io/namespace).(optional) Cleanup all Helm annotations and labels from all resources using
kubectl editcommand.