Operator Controller (Technology Preview)

Operator Controller is the central component of Operator Lifecycle Manager (OLM) 1.0 and consumes the other OLM 1.0 components, RukPak and catalogd. It extends Kubernetes with an API through which users can install Operators and extensions.

OLM 1.0 is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.

For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.

Operator API

Operator Controller provides a new Operator API object, which is a single resource that represents an instance of an installed Operator. This operator.operators.operatorframework.io API streamlines management of installed Operators by consolidating user-facing APIs into a single object.

In OLM 1.0, Operator objects are cluster-scoped. This differs from earlier OLM versions where Operators could be either namespace-scoped or cluster-scoped, depending on the configuration of their related Subscription and OperatorGroup objects.

For more information about the earlier behavior, see Multitenancy and Operator colocation.

Example Operator object

  1. apiVersion: operators.operatorframework.io/v1alpha1
  2. kind: Operator
  3. metadata:
  4. name: <operator_name>
  5. spec:
  6. packageName: <package_name>
  7. channel: <channel_name>
  8. version: <version_number>

When using the OpenShift CLI (oc), the Operator resource provided with OLM 1.0 during this Technology Preview phase requires specifying the full <resource>.<group> format: operator.operators.operatorframework.io. For example:

  1. $ oc get operator.operators.operatorframework.io

If you specify only the Operator resource without the API group, the CLI returns results for an earlier API (operator.operators.coreos.com) that is unrelated to OLM 1.0.

Additional resources

About target versions in OLM 1.0

In Operator Lifecycle Manager (OLM) 1.0, cluster administrators set the target version of an Operator declaratively in the Operator’s custom resource (CR).

If you specify a channel in the Operator’s CR, OLM 1.0 installs the latest release from the specified channel. When updates are published to the specified channel, OLM 1.0 automatically updates to the latest release from the channel.

Example CR with a specified channel

  1. apiVersion: operators.operatorframework.io/v1alpha1
  2. kind: Operator
  3. metadata:
  4. name: quay-example
  5. spec:
  6. packageName: quay-operator
  7. channel: stable-3.8 (1)
1Installs the latest release published to the specified channel. Updates to the channel are automatically installed.

If you specify the Operator’s target version in the CR, OLM 1.0 installs the specified version. When the target version is specified in the Operator’s CR, OLM 1.0 does not change the target version when updates are published to the catalog.

If you want to update the version of the Operator that is installed on the cluster, you must manually update the Operator’s CR. Specifying a Operator’s target version pins the Operator’s version to the specified release.

Example CR with the target version specified

  1. apiVersion: operators.operatorframework.io/v1alpha1
  2. kind: Operator
  3. metadata:
  4. name: quay-example
  5. spec:
  6. packageName: quay-operator
  7. version: 3.8.12 (1)
1Specifies the target version. If you want to update the version of the Operator that is installed on the cluster, you must manually update this field the Operator’s CR to the desired target version.

If you want to change the installed version of an Operator, edit the Operator’s CR to the desired target version.

In previous versions of OLM, Operator authors could define upgrade edges to prevent you from updating to unsupported versions. In its current state of development, OLM 1.0 does not enforce upgrade edge definitions. You can specify any version of an Operator, and OLM 1.0 attempts to apply the update.

You can inspect an Operator’s catalog contents, including available versions and channels, by running the following command:

Command syntax

  1. $ oc get package <catalog_name>-<package_name> -o yaml

After you create or update a CR, create or configure the Operator by running the following command:

Command syntax

  1. $ oc apply -f <extension_name>.yaml

Troubleshooting

  • If you specify a target version or channel that does not exist, you can run the following command to check the status of your Operator:

    1. $ oc get operator.operators.operatorframework.io <operator_name> -o yaml

    Example output

    1. apiVersion: operators.operatorframework.io/v1alpha1
    2. kind: Operator
    3. metadata:
    4. annotations:
    5. kubectl.kubernetes.io/last-applied-configuration: |
    6. {"apiVersion":"operators.operatorframework.io/v1alpha1","kind":"Operator","metadata":{"annotations":{},"name":"quay-example"},"spec":{"packageName":"quay-operator","version":"999.99.9"}}
    7. creationTimestamp: "2023-10-19T18:39:37Z"
    8. generation: 3
    9. name: quay-example
    10. resourceVersion: "51505"
    11. uid: 2558623b-8689-421c-8ed5-7b14234af166
    12. spec:
    13. packageName: quay-operator
    14. version: 999.99.9
    15. status:
    16. conditions:
    17. - lastTransitionTime: "2023-10-19T18:50:34Z"
    18. message: package 'quay-operator' at version '999.99.9' not found
    19. observedGeneration: 3
    20. reason: ResolutionFailed
    21. status: "False"
    22. type: Resolved
    23. - lastTransitionTime: "2023-10-19T18:50:34Z"
    24. message: installation has not been attempted as resolution failed
    25. observedGeneration: 3
    26. reason: InstallationStatusUnknown
    27. status: Unknown
    28. type: Installed