eclipse-che / che

Kubernetes based Cloud Development Environments for Enterprise Teams
http://eclipse.org/che
Eclipse Public License 2.0
6.98k stars 1.19k forks source link

Handling of `olm-suggested-namespace` is strange and unintuitive #21424

Closed amisevsk closed 2 years ago

amisevsk commented 2 years ago

Describe the bug

When using chectl server:deploy with the olm installer on OpenShift, there are two steps:

  1. Install the Che Operator on the cluster
  2. Create a CheCluster (the operand) to install Che components (managed by the Che Operator).

Normally, installing Che will install the Operator to the openshift-operators namespace (the default for 'all-namespaces' operators), and create the CheCluster in the eclipse-che namespace.

However, defining these options in chectl is very strange. The relevant options are

By default, --olm-suggested-namespace is assumed, and the -n flag is ignored. However, from an OLM perspective,

In order to install Eclipse Che so that

  1. The Che Operator is installed in openshift-operators
  2. The CheCluster is installed in an alternate namespace, e.g. my-namespace

it's necessary to specify the arguments

chectl server:deploy -n "my-namespace" --no-olm-suggested-namespace

which is confusing as the OLM suggested namespace should have no bearing on where the CheCluster is created.

Che version

next (development version)

Steps to reproduce

Execute chectl server:deploy -p openshift

Expected behavior

Now that the Che Operator is an 'all-namespaces' operator, the --[no-]olm-suggested-namespace flags should be removed. Chectl does not support installing the Operator itself to a different namespace (to my knowledge) and is currently using this parameter to control where the CheCluster is deployed.

Runtime

OpenShift

Screenshots

No response

Installation method

chectl/next

Environment

Linux

Eclipse Che Logs

No response

Additional context

No response

nickboldt commented 2 years ago

A related change in chectl that affects how downstream dsc behaves is:

https://github.com/che-incubator/chectl/commit/78914cfeb5fec8b1c88163a8682f96d879dd75cc#diff-cd7d31f9ae278a35a9874f61cb1f17509d27a3d98e4b5c59566e578b72e3d537L51

-         ctx.operatorNamespace = flags.chenamespace || DEFAULT_CHE_NAMESPACE
          ctx.operatorNamespace = DEFAULT_OPENSHIFT_OPERATORS_NS_NAME

So now, with 7.48.1/main version of chectl, it seems that installation with both --olm-suggested-namespace and --no-olm-suggested-namespace do the same thing. See details in:

https://issues.redhat.com/browse/CRW-2998?focusedCommentId=20329115&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-20329115

nickboldt commented 2 years ago

At the very least, perhaps we want to reverse the default on/off setting here for the 7.46.x branch == 3.0?

    'olm-suggested-namespace': boolean({
      default: true, 
      allowNo: true,
      description: `Indicate to deploy Red Hat OpenShift Dev Spaces in OLM suggested namespace: '${DEFAULT_OLM_SUGGESTED_NAMESPACE}'.
                    Flag 'chenamespace' is ignored in this case
                    This parameter is used only when the installer is 'olm'.`,

-- https://github.com/redhat-developer/devspaces-chectl/blob/devspaces-3.0-rhel-8/src/commands/server/deploy.ts#L166-L171

replace with:

    'olm-suggested-namespace': boolean({
      default: false, 
      allowNo: true,
      description: `Deploy Red Hat OpenShift Dev Spaces CheCluster and related deployments, 
                    pods, routes in default namespace: '${DEFAULT_OLM_SUGGESTED_NAMESPACE}'. 
                    If using custom namespace flag 'chenamespace', must use `--no-olm-suggested-namespace`
tolusha commented 2 years ago

I removed olm-suggested-namespace flag since it make no sense now