Repository navigation
|
Hello, I have a last Openshift cluster that is still running flux 2.3.0 and would like to upgrade flux to latest. When I tried removing old operator and install latest one it complained about crd that it cannot upgrade. Could someone help me with procedure that would avoid removing crds by hand that would get me to latest version? Cluster is running for almost 5 years so lot happened to it :) |
Replies: 6 comments 1 reply
|
don’t uninstall / delete the old operator (or CRDs) and reinstall. that is what triggers the CRD fight. Flux is meant to upgrade in place from any pick the path that matches how this cluster was installed (5 years in, it is almost certainly one of these): 1. Bootstrap (most common)rerun the same or update Git yourself: # from the bootstrap repo
flux install --export > ./clusters/<cluster>/flux-system/gotk-components.yaml
# keep any OpenShift patches / scc.yaml in kustomization.yaml
git add -A && git commit -m "Upgrade Flux controllers"
git push
flux reconcile ks flux-system --with-source # if you have cluster access2. Plain kubectl installkubectl apply --server-side -f https://github.com/fluxcd/flux2/releases/latest/download/install.yaml3. Flux Operator / OperatorHub (OpenShift)update the operator first, then bump OpenShift specifics
if it still complains about CRDspaste the exact once you are on a recent 2.7+ train, skim Upgrade Procedure for Flux v2.7+ for any extra steps that apply after the bump. |
|
thanks for replay @tomm1990, I have old install on OpenShift with operator. So I should keep both running for the time of migration or remove old one that is deprecated and then install new one one with flux instance locked to 2.4 or pre 2.7 version? |
|
Thanks you @tomm1990 for detailed answer, I'm running this procedure now but my status is still |
|
I'm not sure if I should remove old operator and then new operator will roll out flux-instance and take over will happen? |
|
@siwyroot short answer: do not wait for removing the old operator to "trigger" takeover - your paste already shows takeover of the distribution side is done.
What to do now
About That line is expected. Check the controllers themselves, e.g.: flux trace deploy/source-controller -n flux-system
flux trace deploy/kustomize-controller -n flux-system
oc -n flux-system get deploy,fluxinstanceYour Order reminder (same as before) new operator + Ready So: remove the old operator now; do not delete CRDs hoping that finishes migration. If anything breaks after the uninstall, paste the new |
|
@tomm1990 thank you for all your help, got little confused what I should expect. After removing old operator, new one rolled flux-instance and everything is working. |
don’t remove the old operator first and then install the new one - that’s the path that blew up on CRDs. also don’t run two operators that both try to own the Flux controllers for long.
the supported move onto the current Flux Operator is a takeover, not a wipe (migration guide):
oc delete crd, no uninstall of the toolkit).flux-system) - alongside what you have today.FluxInstancenamedfluxthat matches your current sync (repo/url/path/branch, components, pull secret) and OpenShift: