Skip to content

Conversation

@jhadvig
Copy link
Member

@jhadvig jhadvig commented Jan 3, 2020

Story: https://issues.redhat.com/browse/CONSOLE-1670

If the operator has defined a recommended namespace where it should be installed, it should be shown to the user upon the install process, so user can either honor the operator recommendation or pick an available namespace based on the install mode.

In case the operator is recommending an install namespace, there are also two cases:

  • AllNamespace install mode, where we default to the recommended namespace

Screen Shot 2020-01-03 at 18 35 10

or user can pick openshift-operators namespace
Screen Shot 2020-01-03 at 18 35 19

  • OwnNamespace install mode, where user can either honor the recommended namespace

Screen Shot 2020-01-03 at 18 37 13

or pick any available namespace

Screen Shot 2020-01-03 at 18 37 24

In case the operator is not recommending an install namespace, there are also two cases:

  • AllNamespace install mode, where only the openshift-operators namespace will be available in the disabled namespace dropdown

Screen Shot 2020-01-03 at 18 29 18

  • OwnNamespace install mode, where user can pick any available namespace

Screen Shot 2020-01-03 at 18 29 34

Worked the design out with @itsptk

Still working on the PR.

/assign @spadgett

@benjaminapetersen fyi

@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 3, 2020
@openshift-ci-robot openshift-ci-robot added component/olm Related to OLM approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 3, 2020
@spadgett
Copy link
Member

spadgett commented Jan 3, 2020

cc @shawn-hurley @bparees

Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

I know this is still WIP, but wanted to get you feedback.

Copy link
Member

Choose a reason for hiding this comment

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

operatorframework.io/suggested-namespace

https://github.com/openshift/enhancements/blob/master/enhancements/olm/olm-managed-operator-metrics.md#fulfilling-namespace-and-rbac-requirements

We should change the var name here since it's not really forced.

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const isOpenshiftNamespace = (ns: string): boolean => {
const isOpenShiftNamespace = (ns: string): boolean => {

Copy link
Member

Choose a reason for hiding this comment

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

avoid inline styles

Copy link
Member

Choose a reason for hiding this comment

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

I'd call this enableMonitoringCheckbox

Copy link
Member

Choose a reason for hiding this comment

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

avoid inline styles

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const newNamespace = {
const newNamespace: K8sResourceCommon = {

Copy link
Member

Choose a reason for hiding this comment

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

I think we need an else here, otherwise we'll just use whatever the previous value was.

Copy link
Member

Choose a reason for hiding this comment

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

Better to use catch

Suggested change
(err) => setError(err.message),
.catch(({ message = 'Could not create namespace.' }) => setError(message),

Copy link
Member

Choose a reason for hiding this comment

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

Better to use .then(...).catch(...)

Copy link
Member

Choose a reason for hiding this comment

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

We should consider converting this to async/await, which would simplify things

@spadgett
Copy link
Member

spadgett commented Jan 3, 2020

Based on https://github.com/openshift/enhancements/blob/master/enhancements/olm/olm-managed-operator-metrics.md#fulfilling-namespace-and-rbac-requirements, it doesn't sound like we need the checkbox.

The operatorframework.io/cluster-monitoring=true annotation. When this annotation is set to true, the OpenShift Console will update the namespace that the operator is being deployed to with the openshift.io/cluster-monitoring=true label. When this annotation is present, the UI will update the OpenShift Monitoring Prometheus Operator ServiceAccount with the appropriate RBAC privileges for the given namespace as well, allowing operators to be scraped by the OpenShift Monitoring Prometheus Operator.

I'm not sure it should be the console's responsibility to update RBAC for the service account. @shawn-hurley @bparees ?

@spadgett
Copy link
Member

spadgett commented Jan 3, 2020

it doesn't sound like we need the checkbox.

Disregard, I see this is discussed here in openshift/openshift-origin-design#307 (comment)

@spadgett spadgett added this to the v4.4 milestone Jan 3, 2020
@bparees
Copy link

bparees commented Jan 3, 2020

the "own namespace" cases where you are using an existing namespace do not offer the "enable monitoring" checkbox.

I think we should be offering that checkbox for any operator that requests monitoring, regardless of whether you are installing to its chosen namespace, or another one. Though it is a bit tricky in the case that you are picking a namespace that can't be monitored (isn't openshift-*) (you can still label it for monitoring but nothing will happen).

i'd also like @s-urbaniak and @lilic to review the "warning text" that goes with the enable monitoring checkbox. I'm not sure it's sufficiently cautionary in its current form.

@itsptk
Copy link

itsptk commented Jan 3, 2020

Just wanted to mention that the UX design always has a separate radio option for selecting the targetNamespace, regardless if it is being created at this point or not: openshift/openshift-origin-design#307

Just noticed that wasn't what was being conveyed in the initial comment's screenshots, though Jakub and I were working out this design basically simultaneously when this PR was opened.

Copy link

@lilic lilic left a comment

Choose a reason for hiding this comment

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

Left suggestion for the note.

Just a side note, we should not merge the PR until the e2e tests that were agreed with the OLM team are in place in origin. Not sure there is a PR or work on that for that already @shawn-hurley @awgreene?

Copy link

Choose a reason for hiding this comment

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

As mentioned in the other PR openshift/openshift-origin-design#307 (comment) we really want to warn the user that if they install a non redhat operator into an openshift namespace with enabled monitoring, that this voids user support. We should be clear on that, as that is the potential consequence of this action.

Copy link
Contributor

Choose a reason for hiding this comment

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

I underline the severity of enabling monitoring in this case too. It voids user support as @lilic mentioned.

Copy link
Member Author

Choose a reason for hiding this comment

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

I underline the severity of enabling monitoring in this case too. It voids user support

@lilic @s-urbaniak @bparees in that case are we sure we want to give the user and way how to fiddle with the monitoring? Seeing all the comments (here and in the design PR) I wonder if we won't shoot ourselves into the leg with this single checkbox, since the variety of all the use-cases is just and potential damages is just too big.
Thinking if it wont be for the best to leave it out for now and just aim for the suggested-namespace.

Thoughts ?

Copy link

Choose a reason for hiding this comment

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

@lilic @s-urbaniak @bparees in that case are we sure we want to give the user and way how to fiddle with the monitoring?

yes because we want to make the install story for redhat operators better than it currently is. that's the primary purpose of this feature.

@spadgett spadgett force-pushed the 1670-1-ns branch 8 times, most recently from 46e067d to 4d4a0a5 Compare January 24, 2020 01:11
@spadgett spadgett changed the title [WIP] Operator defined install namespace Operator defined install namespace Jan 24, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 24, 2020
Copy link
Contributor

@benjaminapetersen benjaminapetersen left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 24, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: benjaminapetersen, jhadvig

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@spadgett
Copy link
Member

/refresh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. component/olm Related to OLM lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants