Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Run Version Migration Job on Upgrade #228

Open
1 task done
adambkaplan opened this issue Sep 16, 2024 · 3 comments
Open
1 task done

[FEATURE] Run Version Migration Job on Upgrade #228

adambkaplan opened this issue Sep 16, 2024 · 3 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@adambkaplan
Copy link
Member

Is there an existing feature request for this?

  • I have searched the existing feature requests

Is your feature request related to a problem or use-case? Please describe.

In shipwright-io/build#1603, a version migration script was added to the install/upgrade instructions. This script launches a kubernetes Job that ensures all existing Shipwright Build objects use the v1beta1 API.

Describe the solution that you would like.

The operator should implement the script's logic within a controller. It should do the following:

  • (optional) Determine if this is a new installation, or an upgrade.
  • On upgrade (or always?), start the Job to initiate the migration
  • Reconcile and report status of the version migration Job.

Describe alternatives you have considered.

Keep as "manual instructions" when upgrading. This is not desired for an operator.

Anything else?

Question regarding the migration job - is this idempotent? Will it always succeed, even if there are no objects to update?

@adambkaplan adambkaplan added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 16, 2024
@adambkaplan adambkaplan added this to the release-v0.14.0 milestone Sep 16, 2024
@adambkaplan
Copy link
Member Author

Moving to 0.15.0 - this won't make the 0.14 release.

@adambkaplan
Copy link
Member Author

Kubernetes has two related projects with APIs that solve the problem for us:

  1. Kubernetes-sigs storage version migrator. Some kubernetes distros like OpenShift come packaged with this (I think)
  2. The StorageVersionMigrator feature gate - alpha in k8s 1.30: https://kubernetes.io/docs/tasks/manage-kubernetes-objects/storage-version-migration/

@adambkaplan
Copy link
Member Author

adambkaplan commented Feb 6, 2025

From refinement - we will "codify" the approach in shipwright-io/build#1603, utilizing the knative storage migrator. This ensures we don't rely on external dependencies or alpha Kubernetes features.

Once StorageVersionMigrator reaches beta, we can consider removing this job for future CRD version migrations (and switch to the Kubernetes-native solution)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
Status: Todo
Development

No branches or pull requests

1 participant