cilium / cilium-olm

Other
10 stars 13 forks source link

OLM-friendly upgrades #45

Open errordeveloper opened 3 years ago

errordeveloper commented 3 years ago

Marketplace installation has been documented and validated: https://gist.github.com/errordeveloper/d63200d0e2aeb594599575335e1cac97

Upgrades should work if user updates Subscription object, but OLM is still unaware of Cilium release graph, as each CSV is currently published as an "orphan".

OLM documentation: https://docs.openshift.com/container-platform/4.2/operators/understanding_olm/olm-understanding-olm.html

montaguethomas commented 2 years ago

BLUF

Do not create the ClusterServiceVersion object manually for cilium. Only let OLM create one from the Subscription and CatalogSource.

rm manifests/cilium.v1.10.4/cluster-network-06-cilium-00014-cilium.v1.10.4-x5bfd7b3-clusterserviceversion.yaml

Before

Installing cilium-olm v1.10.4 (v1.10.4-x5bfd7b3) via the provided manifests during cluster bootstrapping results in OLM being unable to manage/upgrade the operator.

image

Design

This issue is due to how OLM handles Subscriptions, InstallPlans, and ClusterServiceVersions. The designed flow is a Subscription is first created. This triggers OLM to determine a version to install from the CatalogSource index and creates an InstallPlan for the version. In doing this, OLM will then create the ClusterServiceVersion object defined by the version's manifest.

While it is possible to use OLM with a manually created ClusterServiceVersion, it ends up creating a disconnect from the Subscription due to missing InstallPlans and owner references.

After

By not defining a ClusterServiceVersion manifest to apply at cluster bootstrap and only a Subscription object, once OLM is running in the cluster it is able to properly step through the designed process for operator installations. OLM will determine the desired version to install, if found in the CatalogSource, creates an InstallPlan and a ClusterServiceVersion.

image

Unpublished Version

If you were to install a cilium-olm version that is not published/available in a CatalogSource, as it does currently, cilium will still be installed correctly during cluster bootstrapping. But since the Subscription object defines spec.startingCSV with the desired version, OLM won't be able to find a version to install (InstallPlan and ClusterServiceVersion). In OpenShift/OKD, the Subscription object will be displayed in the UI instead of the ClusterServiceVersion. Once the spec.startingCSV version is found in the CatalogSource, OLM will properly handle the creation of an InstallPlan and ClusterServiceVersion. Otherwise, manual action is required to update the Subscription to either update or remove the spec.startingCSV field.