operator-framework / operator-lifecycle-manager

A management framework for extending Kubernetes with Operators
https://olm.operatorframework.io
Apache License 2.0
1.71k stars 544 forks source link

Deploy Operator through OLM that selects only one namespace #1297

Closed orenc1 closed 4 years ago

orenc1 commented 4 years ago

Type of question

How to implement a specific feature

Question

What did you do? I'm trying to modify an operator CSV, that it would support deployment on only one selected namespace, using OperatorHub UI. I configured InstallMode CSV section as such:

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

And the OperatorGroup associated with this operator/subscription is configured with spec.targetNamespaces:

apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  name: "${TARGET_NAMESPACE}-group"
  namespace: "${TARGET_NAMESPACE}"
spec:
  targetNamespaces:
  - "${TARGET_NAMESPACE}"

What did you expect to see? I expect that the operator would be successfully deployed on the cluster, on the provided TARGET_NAMESPACE value. The rationale of using this feature is that users will be able to install the operator only at a single namespace, and the default option would be greyed-out in "Operator Subscription" page in OperatorHub UI . This functionality has been adopted by many operators, e.g. 3scale: image

I expect our operator to support installation on a single (chosen) namespace only.

What did you see instead? Under which circumstances? Upon subscription, I got the following status & event:

Status:
  Conditions:
    Last Transition Time:  2020-02-17T16:31:36Z
    Last Update Time:      2020-02-17T16:31:36Z
    Message:               AllNamespaces InstallModeType not supported, cannot configure to watch all namespaces
    Phase:                 Failed
    Reason:                UnsupportedOperatorGroup
  Last Transition Time:    2020-02-17T16:31:36Z
  Last Update Time:        2020-02-17T16:31:36Z
  Message:                 AllNamespaces InstallModeType not supported, cannot configure to watch all namespaces
  Phase:                   Failed
  Reason:                  UnsupportedOperatorGroup
Events:
  Type     Reason                    Age   From                        Message
  ----     ------                    ----  ----                        -------
  Warning  UnsupportedOperatorGroup  19s   operator-lifecycle-manager  AllNamespaces InstallModeType not supported, cannot configure to watch all namespaces

Environment

Additional context This is the relevant PR that tries to use this functionallity: https://github.com/kubevirt/hyperconverged-cluster-operator/pull/408

Thanks.

fabiand commented 4 years ago

ping?

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

orenc1 commented 4 years ago

The issue was on the environment. This feature works as expected. Closing this one.