Skip to content

Commit 3f00bc6

Browse files
authored
Merge pull request #78471 from skrthomas/OSDOCS-11241
OSDOCS-11241: migrate from removed stored versions of CR
2 parents d3f554d + 62b6bd4 commit 3f00bc6

File tree

3 files changed

+79
-0
lines changed

3 files changed

+79
-0
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
// Module included in the following assemblies:
2+
3+
// * networking/network_observability/installing-operators.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="network-observability-updating-migrating_{context}"]
7+
= Migrating removed stored versions of the FlowCollector CRD
8+
9+
Network Observability Operator version 1.6 removes the old and deprecated `v1alpha1` version of the `FlowCollector` API. If you previously installed this version on your cluster, it might still be referenced in the `storedVersion` of the `FlowCollector` CRD, even if it is removed from the etcd store, which blocks the upgrade process. These references need to be manually removed.
10+
11+
There are two options to remove stored versions:
12+
13+
. Use the Storage Version Migrator Operator.
14+
. Uninstall and reinstall the Network Observability Operator, ensuring that the installation is in a clean state.
15+
16+
.Prerequisites
17+
* 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`.
18+
19+
.Procedure
20+
. Verify that the old `FlowCollector` CRD version is still referenced in the `storedVersion`:
21+
+
22+
[source,terminal]
23+
----
24+
$ oc get crd flowcollectors.flows.netobserv.io -ojsonpath='{.status.storedVersions}'
25+
----
26+
. 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.
27+
.. *Option 1: Kubernetes Storage Version Migrator*: Create a YAML to define the `StorageVersionMigration` object, for example `migrate-flowcollector-v1alpha1.yaml`:
28+
+
29+
[source,yaml]
30+
----
31+
apiVersion: migration.k8s.io/v1alpha1
32+
kind: StorageVersionMigration
33+
metadata:
34+
name: migrate-flowcollector-v1alpha1
35+
spec:
36+
resource:
37+
group: flows.netobserv.io
38+
resource: flowcollectors
39+
version: v1alpha1
40+
----
41+
... Save the file.
42+
... Apply the `StorageVersionMigration` by running the following command:
43+
+
44+
[source,terminal]
45+
----
46+
$ oc apply -f migrate-flowcollector-v1alpha1.yaml
47+
----
48+
... Update the `FlowCollector` CRD to manually remove `v1alpha1` from the `storedVersion`:
49+
+
50+
[source,terminal]
51+
----
52+
$ oc edit crd flowcollectors.flows.netobserv.io
53+
----
54+
.. *Option 2: Reinstall*: Save the Network Observability Operator 1.5 version of the `FlowCollector` CR to a file, for example `flowcollector-1.5.yaml`.
55+
+
56+
[source,terminal]
57+
----
58+
$ oc get flowcollector cluster -o yaml > flowcollector-1.5.yaml
59+
----
60+
... Follow the steps in "Uninstalling the Network Observability Operator", which uninstalls the Operator and removes the existing `FlowCollector` CRD.
61+
... Install the Network Observability Operator latest version, 1.6.0.
62+
... Create the `FlowCollector` using backup that was saved in Step b.
63+
64+
.Verification
65+
* Run the following command:
66+
+
67+
[source,terminal]
68+
----
69+
$ oc get crd flowcollectors.flows.netobserv.io -ojsonpath='{.status.storedVersions}'
70+
----
71+
The list of results should no longer show `v1alpha1` and only show the latest version, `v1beta1`.

observability/network_observability/installing-operators.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ For more general information about Flow Collector specifications and the Network
5858
* xref:../../observability/network_observability/troubleshooting-network-observability.adoc#controller-manager-pod-runs-out-of-memory_network-observability-troubleshooting[Troubleshooting Network Observability controller manager pod runs out of memory]
5959
* xref:../../observability/network_observability/understanding-network-observability-operator.adoc#network-observability-architecture_nw-network-observability-operator[Network Observability architecture]
6060
61+
include::modules/network-observability-updating-migrating.adoc[leveloffset=+2]
62+
[role="_additional-resources"]
63+
.Additional resources
64+
* xref:../../operators/operator-reference.adoc#cluster-kube-storage-version-migrator-operator_cluster-operators-ref[Kubernetes Storage Version Migrator Operator]
6165
6266
include::modules/network-observability-kafka-option.adoc[leveloffset=+1]
6367
[role="_additional-resources"]

observability/network_observability/network-observability-operator-release-notes.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ The following advisory is available for the Network Observability Operator 1.6.0
1919

2020
* link:https://access.redhat.com/errata/RHSA-2024:3868[Network Observability Operator 1.6.0]
2121

22+
[IMPORTANT]
23+
====
24+
Before upgrading to the latest version of the Network Observability Operator, you must xref:../../observability/network_observability/installing-operators.adoc#network-observability-updating-migrating_network_observability[Migrate removed stored versions of the FlowCollector CRD]. An automated solution to this workaround is planned with https://issues.redhat.com/browse/NETOBSERV-1747(*NETOBSERV-1747*).
25+
====
2226
[id="network-observability-operator-1.6.0-features-enhancements_{context}"]
2327
=== New features and enhancements
2428

0 commit comments

Comments
 (0)