1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/network-observability-updating-migrating.adoc

73 lines
3.0 KiB
Plaintext

// Module included in the following assemblies:
// * networking/network_observability/installing-operators.adoc
:_mod-docs-content-type: PROCEDURE
[id="network-observability-updating-migrating_{context}"]
= Migrating removed stored versions of the FlowCollector CRD
[role="_abstract"]
Manually remove the deprecated `v1alpha1` version from the `FlowCollector` custom resource definition (CRD) `storedVersion` list to prevent upgrade errors and successfully migrate to Network Observability Operator 1.6.
There are two options to remove stored versions:
. Use the Storage Version Migrator Operator.
. Uninstall and reinstall the Network Observability Operator, ensuring that the installation is in a clean state.
.Prerequisites
* You have an older version of the Operator installed, and you want to prepare your cluster to install the latest version of the Operator. Or you have attempted to install the Network Observability Operator 1.6 and run into the error: `Failed risk of data loss updating "flowcollectors.flows.netobserv.io": new CRD removes version v1alpha1 that is listed as a stored version on the existing CRD`.
.Procedure
. Verify that the old `FlowCollector` CRD version is still referenced in the `storedVersion`:
+
[source,terminal]
----
$ oc get crd flowcollectors.flows.netobserv.io -ojsonpath='{.status.storedVersions}'
----
. If `v1alpha1` appears in the list of results, proceed with *Step a* to use the Kubernetes Storage Version Migrator or *Step b* to uninstall and reinstall the CRD and the Operator.
.. *Option 1: Kubernetes Storage Version Migrator*: Create a YAML to define the `StorageVersionMigration` object, for example `migrate-flowcollector-v1alpha1.yaml`:
+
[source,yaml]
----
apiVersion: migration.k8s.io/v1alpha1
kind: StorageVersionMigration
metadata:
name: migrate-flowcollector-v1alpha1
spec:
resource:
group: flows.netobserv.io
resource: flowcollectors
version: v1alpha1
----
... Save the file.
... Apply the `StorageVersionMigration` by running the following command:
+
[source,terminal]
----
$ oc apply -f migrate-flowcollector-v1alpha1.yaml
----
... Update the `FlowCollector` CRD to manually remove `v1alpha1` from the `storedVersion`:
+
[source,terminal]
----
$ oc edit crd flowcollectors.flows.netobserv.io
----
.. *Option 2: Reinstall*: Save the Network Observability Operator 1.5 version of the `FlowCollector` CR to a file, for example `flowcollector-1.5.yaml`.
+
[source,terminal]
----
$ oc get flowcollector cluster -o yaml > flowcollector-1.5.yaml
----
... Follow the steps in "Uninstalling the Network Observability Operator", which uninstalls the Operator and removes the existing `FlowCollector` CRD.
... Install the Network Observability Operator latest version, 1.6.0.
... Create the `FlowCollector` using backup that was saved in Step b.
.Verification
* Run the following command:
+
[source,terminal]
----
$ oc get crd flowcollectors.flows.netobserv.io -ojsonpath='{.status.storedVersions}'
----
The list of results should no longer show `v1alpha1` and only show the latest version, `v1beta1`.