Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion modules/olm-about-catalogs.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ As a cluster administrator, you can create your own custom index image, either b

[IMPORTANT]
====
When creating custom catalog images, previous versions of {product-title} 4 required using the `oc adm catalog build` command, which was deprecated for several releases and is now removed. With the availability of Red Hat-provided index images starting in {product-title} 4.6, catalog builders must use the `opm index` command to manage index images.
Kubernetes periodically deprecates certain APIs that are removed in subsequent releases. As a result, Operators are unable to use removed APIs starting with the version of {product-title} that uses the Kubernetes version that removed the API.

If your cluster is using custom catalogs, see xref:../../operators/operator_sdk/osdk-working-bundle-images#osdk-control-compat_osdk-working-bundle-images[Controlling Operator compatibility with {product-title} versions] for more details about how Operator authors can update their projects to help avoid workload issues and prevent incompatible upgrades.
====

[NOTE]
====
Support for the legacy _package manifest format_ for Operators, including custom catalogs that were using the legacy format, is removed in {product-title} 4.8 and later.

When creating custom catalog images, previous versions of {product-title} 4 required using the `oc adm catalog build` command, which was deprecated for several releases and is now removed. With the availability of Red Hat-provided index images starting in {product-title} 4.6, catalog builders must use the `opm index` command to manage index images.
====
88 changes: 88 additions & 0 deletions modules/osdk-control-compat.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
// Module included in the following assemblies:
//
// * operators/operator_sdk/osdk-working-bundle-images.adoc

[id="osdk-control-compat_{context}"]
= Controlling Operator compatibility with {product-title} versions

[IMPORTANT]
====
Kubernetes periodically deprecates certain APIs that are removed in subsequent releases. As a result, your Operator projects are unable to use removed APIs starting with the version of {product-title} that uses the Kubernetes version that removed the API.

As an Operator author, it is strongly recommended that you review the link:https://kubernetes.io/docs/reference/using-api/deprecation-guide/[Deprecated API Migration Guide] in Kubernetes documentation and keep your projects up to date to avoid using deprecated and removed APIs. Ideally, you should update your Operator before the release of a future version of {product-title} that would make the Operator incompatible.
====

When an API is removed from an {product-title} version, Operators running on that cluster version that are still using removed APIs will no longer work properly. As an Operator author, you should plan to update your Operator projects to accommodate API deprecation and removal to avoid interruptions for users of your Operator.

[TIP]
====
You can check the event alerts of your Operators running on {product-title} 4.8 and later to find whether there are any warnings about APIs currently in use. The following alerts fire when they detect an API in use that will be removed in the next release:

`APIRemovedInNextReleaseInUse`::
APIs that will be removed in the next OpenShift Container Platform release.

`APIRemovedInNextEUSReleaseInUse`::
APIs that will be removed in the next OpenShift Container Platform link:https://access.redhat.com/support/policy/updates/openshift#ocp4_phases[Extended Update Support (EUS)] release.
====

If a cluster administrator has installed your Operator, before they upgrade to the next version of {product-title}, they must ensure a version of your Operator is installed that is compatible with that next cluster version. While it is recommended that you update your Operator projects to no longer use deprecated or removed APIs, if you still need to publish your Operator bundles with removed APIs for continued use on earlier versions of {product-title}, ensure that the bundle is configured accordingly.

The following procedure helps prevent administrators from installing versions of your Operator on an incompatible version of {product-title}. These steps also prevent administrators from upgrading to a newer version of {product-title} that is incompatible with the version of your Operator that is currently installed on their cluster.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to highlight here something like:

IMPORTANT: You should only following the next steps if you have 100% sure that your operator will not work in the specific OPC version. For example, if you need to publish a version using v1betav1 CRD APIs then you know that it will be removed in 1.22 and consequently you should define that the Max OCP Version valid for your operator is 4.8.

Copy link
Contributor Author

@adellape adellape Jul 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is better addressed now between the changes mentioned in #34166 (comment) and #34166 (comment).


[IMPORTANT]
====
You should configure the following settings in your Operator project as soon as possible. Users running workloads with deprecated APIs that are planning to eventually upgrade to a future version of {product-title} must be running an Operator that has the proper configuration to avoid a cluster upgrade to an incompatible version and potentially adversely impact their critical workloads.
====

.Prerequisites

- Operator SDK CLI installed on a development workstation
- Operator project initialized by using the Operator SDK
Comment on lines +37 to +40
Copy link

@camilamacedo86 camilamacedo86 Jul 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not have these pre-requisites for this scenario. We need to remove that. Sorry for not get this before.

Copy link
Contributor Author

@adellape adellape Jul 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


.Procedure

. Configure the maximum version of {product-title} that your Operator is compatible with. In your Operator project's cluster service version (CSV), set the `olm.openShiftMaxVersion` annotation to prevent administrators from upgrading their cluster before upgrading the installed Operator to a compatible version:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also just noticed that on this line it's olm.openShiftMaxVersion, but in the example below it's olm.maxOpenShiftVersion. There's a similar discrepancy in the following upstream doc:

https://github.com/operator-framework/community-operators/blob/master/docs/packaging-required-criteria-ocp.md#configure-the-max-openshift-version-compatible

Seems like olm.maxOpenShiftVersion is the correct one though, per https://issues.redhat.com/browse/OLM-2074.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is the example sent by OLM team.

  "olm.properties": '[{"type": "olm.maxOpenShiftVersion", "value": "4.8"}]'

+
.Example CSV with `olm.maxOpenShiftVersion` annotation
[source,yaml]
----
apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
annotations:
"olm.properties": '[{"type": "olm.maxOpenShiftVersion", "value": "4.8"}]' <1>
Copy link

@camilamacedo86 camilamacedo86 Jul 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not specifying the scenario of v1beta1 in 4.9, so wdyt about we clarify that and replace the 4.8 for OCP tag version, something such as:

"olm.properties": '[{"type": "olm.maxOpenShiftVersion", "value": "<inform the tag (e.g 4.8)> of the max versions of ocp supported by your operator"}]' <1>

Also, we might indeed take advantage of the scenario that we like to cover by providing some e.g.

Copy link
Contributor Author

@adellape adellape Jul 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

----
<1> Setting `value` to `4.8` prevents cluster upgrades to {product-title} versions later than 4.8 when this bundle is installed on a cluster.
Copy link

@camilamacedo86 camilamacedo86 Jul 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By looking at that, seems that need to supplement it with info to make clear that they should only use that when they know for sure that the specific bundle is not supported and will not work out in versions upper of the informed versions.

Copy link
Contributor Author

@adellape adellape Jul 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some qualification to the very beginning of this first step (new part in bold just to highlight here):

If you know that a specific bundle of your Operator is not supported and will not work correctly on OpenShift Container Platform later than a certain cluster version, configure the maximum version of OpenShift Container Platform that your Operator is compatible with.

See https://github.com/openshift/openshift-docs/pull/34348/files#diff-9a5395e4fb38f80963c37a932625ff0a705ed827f3e2ecc59296e085d709ab44R45.


. If your bundle is intended for distribution in a Red Hat-provided Operator catalog, configure the compatible versions of {product-title} for your Operator by setting the following properties. This configuration ensures your Operator is only included in catalogs that target compatible versions of {product-title}:
+
[NOTE]
====
This step is only valid when publishing Operators in Red Hat-provided catalogs. If your bundle is only intended for distribution in a custom catalog, you can skip this step. For more details, see "Red Hat-provided Operator catalogs".
====

.. Set the `com.redhat.openshift.versions` annotation in your project's `bundle/metadata/annotations.yaml` file:
+
.Example `bundle/metadata/annotations.yaml` file with compatible versions
[source,yaml]
----
com.redhat.openshift.versions: "v4.6-v4.8" <1>
----
<1> Set to a range or single version.

.. To prevent your bundle from being carried on to an incompatible version of {product-title}, ensure that the index image is generated with the proper `com.redhat.openshift.versions` label in your project's `bundle.Dockerfile`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a bit weird to include, because this annotation is only consumed/enforced by the redhat operator pipelines when they assemble catalogs, as far as i know. Someone building an operator that is distributed via their own catalog will not gain any benefit from this. So if we are going to talk about it, i think we need to be more explicit about what it actually accomplishes.

cc @camilamacedo86

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HI @bparees,

Thank you for your help on that. +1

We need to clarify that this step is only valid/useful/required if the bundle will be distributed in`Red Hat-provided Operator catalogs - https://deploy-preview-34166--osdocs.netlify.app/openshift-enterprise/latest/operators/understanding/olm-rh-catalogs.html

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bparees @camilamacedo86 Updated step 2 with the following:

If your bundle is intended for distribution in a Red Hat-provided Operator catalog, configure the compatible versions of OpenShift Container Platform for your Operator by setting the following properties:

NOTE: If your bundle is only intended for distribution in a custom catalog, you can skip this step.

https://deploy-preview-34166--osdocs.netlify.app/openshift-enterprise/latest/operators/operator_sdk/osdk-working-bundle-images#osdk-control-compat_osdk-working-bundle-images

Copy link

@camilamacedo86 camilamacedo86 Jul 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT just we complement with something that makes more clear such as ;

If your bundle is only intended for distribution in a custom catalog, you can skip this step. The following step is only valid for when you publish your operator into Red Hat-provided Operator catalogs

otherwise, it is lgtm for me. Let's see if it is ok for @bparees as welll

Copy link
Contributor Author

@adellape adellape Jul 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated NOTE to say:

This step is only valid when publishing Operators in Red Hat-provided catalogs. If your bundle is only intended for distribution in a custom catalog, you can skip this step. For more details, see "Red Hat-provided Operator catalogs".

In an effort to create a better connection between this NOTE and the actual link to the "Red Hat-provided Operator catalogs" topic, which (unfortunately) has to be down in the "Additional resources" after the procedure.

+
.Example `bundle.Dockerfile` with compatible versions
+
[source,yaml]
----
LABEL com.redhat.openshift.versions="v4.6-v4.8" <1>
----
<1> Set to a range or single version.
+
[NOTE]
====
This label is also useful when you know that the current version of your Operator will not work well, for any reason, on a specific {product-title} version. By using it, you define the cluster versions where the Operator should be distributed, and the Operator does not appear in a catalog of a cluster version which is outside of the range.
Copy link

@camilamacedo86 camilamacedo86 Jul 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The text This label is also useful when you know that the current version of your Operator will not work well actually would better fit in a not for the max OCP version the idea of that is to allow the operator author to define the max OCP version supported by their specific versions of the distribution. Could we improve/fix that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took this out of the "NOTE" format and moved it up into the proper intro paragraphs right before the beginning of the procedure. See https://github.com/openshift/openshift-docs/pull/34348/files#diff-9a5395e4fb38f80963c37a932625ff0a705ed827f3e2ecc59296e085d709ab44R32.

====

You can now bundle a new version of your Operator and publish the updated version to a catalog for distribution.
7 changes: 7 additions & 0 deletions operators/admin/olm-managing-custom-catalogs.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ This guide describes how to work with custom catalogs for Operators packaged usi
Support for the legacy _package manifest format_ for Operators, including custom catalogs that were using the legacy format, is removed in {product-title} 4.8 and later.
====

[IMPORTANT]
====
Kubernetes periodically deprecates certain APIs that are removed in subsequent releases. As a result, Operators are unable to use removed APIs starting with the version of {product-title} that uses the Kubernetes version that removed the API.

If your cluster is using custom catalogs, see xref:../../operators/operator_sdk/osdk-working-bundle-images#osdk-control-compat_osdk-working-bundle-images[Controlling Operator compatibility with {product-title} versions] for more details about how Operator authors can update their projects to help avoid workload issues and prevent incompatible upgrades.
====

.Additional resources

* xref:../../operators/understanding/olm-rh-catalogs.adoc#olm-rh-catalogs[Red Hat-provided Operator catalogs]
Expand Down
7 changes: 7 additions & 0 deletions operators/operator_sdk/osdk-working-bundle-images.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ include::modules/osdk-bundle-upgrade-olm.adoc[leveloffset=+1]

* xref:../../operators/admin/olm-adding-operators-to-cluster.adoc#olm-adding-operators-to-a-cluster[Traditional Operator installation with OLM]

include::modules/osdk-control-compat.adoc[leveloffset=+1]
.Additional resources

* link:https://redhat-connect.gitbook.io/certified-operator-guide/ocp-deployment/operator-metadata/bundle-directory/managing-openshift-versions[Managing OpenShift Versions] in the _Certified Operator Build Guide_
* xref:../../operators/admin/olm-upgrading-operators.adoc#olm-upgrading-operators[Upgrading installed Operators]
* xref:../../operators/understanding/olm-rh-catalogs.adoc#olm-rh-catalogs[Red Hat-provided Operator catalogs]

[id="osdk-working-bundle-images-additional-resources"]
== Additional resources

Expand Down