Giter Site home page Giter Site logo

Comments (7)

njhale avatar njhale commented on May 29, 2024

@eivantsov By default, OLM watches all namespaces in OpenShift 4.0. As of now, a Subscription must exist in a namespace with CatalogSources that contain its dependencies (or they are available in the "global catalog" namespace, openshift-operator-lifecycle-manager). Additionally, a CSV requires a supported OperatorGroup be present in its namespace to provide some minimal multi-tenancy configuration. By supported, I mean that the CSV's InstallModes must match the OperatorGroup's configuration.

If you have a CatalogSource that contains your operator dependencies, I suggest:

  • Creating it in the namespace you want to install your operator in.
  • Create an OperatorGroup that will support your CSV's InstallModes in that namespace.
  • Creating a Subscription that targets your CSV and CatalogSource in that namespace.

from operator-lifecycle-manager.

 avatar commented on May 29, 2024

@njhale thanks, that's helpful. Perhaps you can suggest configuration for the following use case:

  1. The operator is available in OperatorHub.
  2. I need this operator to be only installed in a particular namespace (say, an admin creates a namespace and an OperatorGroup in it)
  3. I do not want the installed Operator to be copied to other namespaces once installed.

If in InstallModes I set:

        installModes:
          - supported: true
            type: OwnNamespace
          - supported: true
            type: SingleNamespace
          - supported: false
            type: MultiNamespace
          - supported: false
            type: AllNamespaces

Will I be able to achieve the above goals? The idea is to make the Operator admin only, since once installed, it will provision resources that will be available cluster wide anyway, and user won't need to do anything but click a route link to start using the service.

from operator-lifecycle-manager.

njhale avatar njhale commented on May 29, 2024

@eivantsov Yes, your InstallModes look correct - you should only need to create an OperatorGroup set to select its own namespace and tell OperatorHub to generate a new CatalogSource containing your operator in your OperatorGroup namespace. I'm not sure if OperatorHub is configured to watch all namespaces, but it it is I'm pretty sure this is achieved by creating a CatalogSourceConfig in the operator-marketplace namespace. From what I remember, this CatalogSourceConfig should select both your operator's package and dependent packages as well as the namespace you want the CatalogSource to be generated in (your OperatorGroup's namespace).

from operator-lifecycle-manager.

aravindhp avatar aravindhp commented on May 29, 2024

I'm not sure if OperatorHub is configured to watch all namespaces,

OperatorHub only watches the operator-marketplace namespace.

From what I remember, this CatalogSourceConfig should select both your operator's package and dependent packages as well as the namespace you want the CatalogSource to be generated in (your OperatorGroup's namespace).

Confirming that this indeed the case. targetNamespace in the CatalogSourceConfig should be set to the namespace you want the CatalogSource to be generated in. This is also the namespace where you need to create the Subscription object for your operator.

from operator-lifecycle-manager.

 avatar commented on May 29, 2024

@njhale @aravindhp I gave it a try with the above InstallModes.

  1. oc create new-project eclipse-che
  2. oc apply -f operatorgroup.yaml -n=eclipse-che
apiVersion: operators.coreos.com/v1alpha2
kind: OperatorGroup
metadata:
  name: global-operators
  1. Installed the operator from Operator Hub in eclipse-che namespace. The installation failed with:

image

  1. I can see that the installed operator showed up in all namespaces as failed:

image

image

from operator-lifecycle-manager.

njhale avatar njhale commented on May 29, 2024

It looks like the operator was not actually installed. There should be no deployment for your operator running in the eclipse-che namespace. While the copied message is not all that helpful, the parent CSV is giving the correct failure message: "AllNamespaces InstallModeType not supported...". Which makes sense given that you created a global operatorgroup (omitting targetNamespaces or selector yields a global operatorgroup):

apiVersion: operators.coreos.com/v1alpha2
kind: OperatorGroup
metadata:
  name: global-operators

And your CSV does not support all namespaces:

installModes:
          .
          .
          .
          - supported: false
            type: AllNamespaces

I suggest updating your operatorgroup:

apiVersion: operators.coreos.com/v1alpha2
kind: OperatorGroup
metadata:
  name: che-group
  namespace: eclipse-che
spec:
  targetNamespaces:
  - eclipse-che

from operator-lifecycle-manager.

 avatar commented on May 29, 2024

@njhale thanks - that was it. I almost got to the stage of looking for OperatorGroup spec somewhere :)

from operator-lifecycle-manager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.