Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add internal image proposal #1097

Merged

Conversation

robszumski
Copy link
Collaborator

Description of the change:
This PR adds a proposal for marking a subset of CRDs as "internal", meaning they are not for end-user consumption or manipulation.

Motivation for the change:
Many Operators have internal concepts that are confusing to end-users when they show up in user interfaces or CLIs like operatorhub.io. This proposal solidifies this concept into a standard convention that others can follow to hide these CRDs and downstream user interfaces by hide them if deemed necessary for their user base.

@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 29, 2019
@joelanford
Copy link
Member

@robszumski Along these same lines, there is also a distinction between workload/application CRDs and data-only CRDs. Such a distinction would make running the SDK scorecard more reliable and may be helpful metadata for a user.

Thoughts on that? And if you agree, would it make sense to include this concept in this proposal as well?

@sbose78
Copy link
Contributor

sbose78 commented Oct 30, 2019

+1 !

We were looking to see if there's a good way to hide some of the CRDs which the users don't need to , on the UI ( and other places where we want to hide out details/abstractions ) :

This sounds like a good idea.

metadata:
name: hivetables.metering.openshift.io
annotations:
operators.coreos.com/internal-object: true
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's make it apps.kubernetes.io/internal-object:true ? :)

@robszumski
Copy link
Collaborator Author

Merging these two comments together would leave us with:

kind: CustomResourceDefinition
apiVersion: apiextensions.k8s.io/v1beta1
metadata:
  name: hivetables.metering.openshift.io
  annotations:
    apps.kubernetes.io/internal-object:true
    apps.kubernetes.io/data-object:true

I don't see any issues with that and can get the proposal updated. WDYT @joelanford @sbose78?

@sbose78
Copy link
Contributor

sbose78 commented Oct 30, 2019

That'll be good, @robszumski .

@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 31, 2019
@robszumski
Copy link
Collaborator Author

PTAL again, updated title, filename and added the new annotations.

@ecordell
Copy link
Member

Unfortunately, we can't use the k8s namespace without upstream approval.

Can we use operators.operatorframework.io prefix like we do for our bundles?

operators.operatorframework.io.bundle.mediatype.v1: "registry+v1" for example

metadata:
name: hivetables.metering.openshift.io
annotations:
apps.kubernetes.io/internal-object:true
Copy link
Member

Choose a reason for hiding this comment

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

apps.operatorframework.io?

@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 1, 2019
@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Nov 1, 2019

@robszumski: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/prow/e2e-aws-console-olm 4cc0432 link /test e2e-aws-console-olm
ci/prow/e2e-aws-olm 4cc0432 link /test e2e-aws-olm

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@bbrowning
Copy link

Would this annotation be appropriate to hide things that should not show up to end-users in things like the Developer Catalog but instead can only be created by cluster admins? Or will this annotation also hide it from cluster admins in screens outside of just the Developer Catalog?

In my case, I want admins to see the option to create a KnativeServing CR from their Installed Operators screen. But I don't want developers to be offered to create a KnativeServing CR from their Developer Catalog. We have RBAC that limits who can create them, but last I checked the Dev Catalog doesn't inspect the RBAC rules for CRs when deciding what to show.

@christianvogt
Copy link

@robszumski what about supporting these annotations on the CSV. Looks like the console will have an issue:
openshift/console#3170 (comment)

@robszumski
Copy link
Collaborator Author

@christianvogt Are you thinking it goes on to spec.customresourcedefinitions.owned? No issues on that for me other than it's now a deeper OLM spec change not an optional field to be read (or not).

@spadgett
Copy link
Contributor

The problem here for console is that normal users can't list CRDs, so there's no way to console read the annotation. We currently look at spec.customresourcedefinitions.owned in the CSV. So this would either need to be a new field there or perhaps an annotation on the CSV itself.

@christianvogt
Copy link

@sbose78 had suggested an annotation on the CSV which was originally a whitelist array of CRDs kinds I believe. A agree though that a blacklist approach is better.

@sbose78
Copy link
Contributor

sbose78 commented Nov 13, 2019

My initial suggestion was to have :

apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
  annotations:
    apps.operatorframework.io/primary-objects: [....] 
  • This avoids the need to make a deeper OLM CSV schema change
  • The typical RBAC design for consumption of OLM lets non-admin users read CSVs compared to reading CRDs. Hence, having it on the CSV might help a bigger audience consume this information.
  • Downside: Doesn't make it OLM agnostic.

What do you folks think ?

@robszumski
Copy link
Collaborator Author

@sbose78 Turning that into a blacklist seems like a good solution to me

@christianvogt
Copy link

An annotation on CSV whose value is an array of names spec.owned.customresourcedefinitions.name.
Blacklist and renamed @sbose78's proposal to align with the previous naming:
operators.operatorframework.io/internal-objects: [...]

@sbose78
Copy link
Contributor

sbose78 commented Nov 14, 2019

@christianvogt & @robszumski :

Sounds good.

  • the blacklist, looks good to me 👍
  • use of spec.owned.customresourcedefinitions.name in the array provides uniqueness, so 👍 .
apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
  annotations:
    apps.operatorframework.io/internal-objects: [....] 

@christianvogt
Copy link

@robszumski @sbose78
Dev console is going to go ahead with aligning on this proposal noted above.

@sbose78
Copy link
Contributor

sbose78 commented Nov 19, 2019

Sounds good.

@abhinandan13jan
Copy link

FYI openshift/console#3518

@abhinandan13jan
Copy link

@sbose78 @christianvogt Please let me know if this is to be changed

@christianvogt & @robszumski :

Sounds good.

  • the blacklist, looks good to me +1
  • use of spec.owned.customresourcedefinitions.name in the array provides uniqueness, so +1 .
apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
  annotations:
    apps.operatorframework.io/internal-objects: [....] 

As part of CR the annotation considered is operators.operatorframework.io/internal-objects and not apps.operatorframework.io/internal-objects mentioned in the quoted comment.

@christianvogt
Copy link

christianvogt commented Dec 3, 2019

@sbose78 @robszumski
Siince the annotation must be a string. I just want to confirm that this will be a stringified JSON array value: eg '["foo","bar"]'

@ecordell
Copy link
Member

@robszumski do you have time to fix this proposal up to match the decisions made in the comments here?

@matzew
Copy link

matzew commented Jan 13, 2020

Is this still planed to be able to hide some CRDs ?

@ecordell
Copy link
Member

@matzew This is already implemented in console

@ecordell
Copy link
Member

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ecordell, robszumski

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

The pull request process is described here

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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 13, 2020
@ecordell
Copy link
Member

doc-only, merging without tests.

@ecordell ecordell merged commit 2187d3e into operator-framework:master Jan 13, 2020
kubevirt-bot pushed a commit to kubevirt/hyperconverged-cluster-operator that referenced this pull request Mar 5, 2020
With github.com/operator-framework/operator-lifecycle-manager/pull/1097
OM supports a mechanism to hide internal CRDs on OLM console.
Start using it.
By default only
- hyperconvergeds.hco.kubevirt.io
- v2vvmwares.kubevirt.io
- hostpathprovisioners.hostpathprovisioner.kubevirt.io
are going to be visible.
The list of visible CRDs can be override as a CLI parameter
to the csv-merger tool.

Signed-off-by: Simone Tiraboschi <stirabos@redhat.com>
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. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet