Skip to content

Implement flux migrate command#5473

Merged
stefanprodan merged 1 commit intomainfrom
cmd-migrate
Aug 11, 2025
Merged

Implement flux migrate command#5473
stefanprodan merged 1 commit intomainfrom
cmd-migrate

Conversation

@stefanprodan
Copy link
Copy Markdown
Member

@stefanprodan stefanprodan commented Aug 8, 2025

The migrate command must be run before a Flux minor version upgrade. The command migrates the Flux custom resources stored in Kubernetes etcd to their latest API version, ensuring the Flux components can continue to function correctly after the upgrade.

⚠️ This is a prerequisite for upgrading Flux to 2.7 when we are removing v1beta1 and v2beta1 from the Flux CRDs as described in the roadmap:

EOL and Deprecations

  • End support for Flux v2.4.x
  • End support for Kubernetes v1.31.x
  • Remove deprecated APIs in group source.toolkit.fluxcd.io/v1beta1
  • Remove deprecated APIs in group kustomize.toolkit.fluxcd.io/v1beta1
  • Remove deprecated APIs in group helm.toolkit.fluxcd.io/v2beta1
  • Remove deprecated APIs in group notification.toolkit.fluxcd.io/v1beta1
  • Remove deprecated APIs in group image.toolkit.fluxcd.io/v1beta1

PS. Users of Flux Operator don't need to run this command before an upgrade as the operator does storage migration automatically.

Example:

$ flux migrate
► starting migration of custom resources
✔ GitRepository/flux-system/flux-system migrated to version v1
✔ HelmChart/apps/apps-podinfo-helm migrated to version v1
✔ HelmChart/cert-manager/cert-manager-cert-manager migrated to version v1
✔ HelmChart/ingress-nginx/ingress-nginx-ingress-nginx migrated to version v1
✔ HelmChart/podinfo/podinfo-podinfo migrated to version v1
✔ HelmRelease/apps/podinfo-helm migrated to version v2
✔ HelmRelease/cert-manager/cert-manager migrated to version v2
✔ HelmRelease/ingress-nginx/ingress-nginx migrated to version v2
✔ HelmRelease/podinfo/podinfo migrated to version v2
✔ HelmRepository/apps/podinfo migrated to version v1
✔ HelmRepository/cert-manager/cert-manager migrated to version v1
✔ HelmRepository/ingress-nginx/ingress-nginx migrated to version v1
✔ HelmRepository/podinfo/podinfo migrated to version v1
✔ Kustomization/flux-system/apps migrated to version v1
✔ Kustomization/flux-system/flux-system migrated to version v1
✔ Kustomization/flux-system/infra-configs migrated to version v1
✔ Kustomization/flux-system/infra-controllers migrated to version v1
✔ custom resources migrated successfully

Closes: #5474

The migrate command must be run before a Flux minor version upgrade.
The command migrates the Flux custom resources stored in Kubernetes etcd to their latest API version, ensuring the Flux components can continue to function correctly after the upgrade.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
@stefanprodan stefanprodan added enhancement New feature or request area/bootstrap Bootstrap related issues and pull requests area/install Install and uninstall related issues and pull requests labels Aug 8, 2025
Comment thread cmd/flux/migrate.go
Comment thread cmd/flux/migrate.go
Copy link
Copy Markdown
Member

@matheuscscp matheuscscp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub is forcing me to write this comment to submit a review lol

Copy link
Copy Markdown
Member

@matheuscscp matheuscscp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀

@stefanprodan stefanprodan merged commit 1408bb8 into main Aug 11, 2025
9 of 10 checks passed
@stefanprodan stefanprodan deleted the cmd-migrate branch August 11, 2025 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/bootstrap Bootstrap related issues and pull requests area/install Install and uninstall related issues and pull requests enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove v1beta1 and v2beta1 deprecated APIs

2 participants