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

CLI in-cluster management #137

Closed
wants to merge 1 commit into from
Closed

Conversation

sallyom
Copy link
Contributor

@sallyom sallyom commented Dec 3, 2019

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 3, 2019
@sallyom sallyom force-pushed the cli-manager branch 10 times, most recently from 7497bd9 to b1110a0 Compare December 5, 2019 21:09
@sdodson
Copy link
Member

sdodson commented Dec 6, 2019

/uncc

@openshift-ci-robot openshift-ci-robot removed the request for review from sdodson December 6, 2019 13:40
@soltysh
Copy link

soltysh commented Dec 9, 2019

/assign

Copy link

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

I'd consider this enhancement to be place at the root directory, since it's not about oc only, but we're trying to solve a higher level issue. oc will be merely one of the consumers.

enhancements/oc/cli_manager.md Outdated Show resolved Hide resolved
enhancements/oc/cli_manager.md Outdated Show resolved Hide resolved
enhancements/oc/cli_manager.md Outdated Show resolved Hide resolved
enhancements/oc/cli_manager.md Outdated Show resolved Hide resolved
enhancements/oc/cli_manager.md Outdated Show resolved Hide resolved
enhancements/oc/cli_manager.md Outdated Show resolved Hide resolved
enhancements/oc/cli_manager.md Outdated Show resolved Hide resolved
enhancements/oc/cli_manager.md Outdated Show resolved Hide resolved
enhancements/oc/cli_manager.md Outdated Show resolved Hide resolved
enhancements/oc/cli_manager.md Outdated Show resolved Hide resolved
@sallyom sallyom force-pushed the cli-manager branch 10 times, most recently from a1d3d6d to 2d7ee86 Compare December 9, 2019 19:28
index location from which the CLI manager will obtain the files.

Two routes for index:
1. Central index that has links to where artifacts are stored

Choose a reason for hiding this comment

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

If an index exists that has the list of CLIs and their location, what would be ConsoleCLIDownload used for?

Copy link
Contributor Author

@sallyom sallyom Jan 15, 2020

Choose a reason for hiding this comment

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

The CRD will hold info for each CLI (available versions, download urls, description, other) that can be gathered via oc get climanageddownload okd -o yaml for example.
or run oc get consoleclidownloads oc-cli-downloads -o yaml to see the current consoleCLIDownload for oc.

Copy link

Choose a reason for hiding this comment

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

I'd imagine we'd deprecate ConsoleCLIDownload in favour of the central index. All the tools serving that information should be using the new central repository.

Choose a reason for hiding this comment

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

Is there a case where an optional operator can not, or doesn't want to, ship their CLI through the central index?

Choose a reason for hiding this comment

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

+1 for the central index which would remove the requirement from the user to have access and be logged into a cluster when she wants to list or install plugins.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The cli-manager will be run within a cluster - so yes, users will have to be logged into a cluster to list or install CLI plugins. This way users will know they are using the CLI version that is known good with whatever version their cluster is. It will be possible to install CLIs outside a cluster, but not through cli-manager.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When I said The cli-manager will be run within a cluster that's not what I meant, really - each cluster will have its set of ClusterCLI CRs - those hold the the known-good CLIs (compatible or latest version, etc) for that cluster. oc will access those when connected to a cluster. Also, I've updated this proposal to move away from cli-manager since what we're actually proposing is extending/adding to oc something like oc clustercli list|search|install


Two routes for index:
1. Central index that has links to where artifacts are stored
2. Central repository where all artifacts are stored

Choose a reason for hiding this comment

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

Isn't this the existing mirror.openshift?
https://mirror.openshift.com/pub/openshift-v4/clients/

CLIs are already being published there today by the CLI creators.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added that info.

@sallyom sallyom force-pushed the cli-manager branch 3 times, most recently from 598c515 to 8f8ee7e Compare November 15, 2020 15:22
@sallyom
Copy link
Contributor Author

sallyom commented Nov 15, 2020

@smarterclayton ok to merge this now? Proposal is to keep current downloads (with new CRD instead of consol-cli-downloads) available via fileserver and adding option to install tools via oc (oc image extract logic and obtaining artifact mapping artifact info from CR)

### Goals

Each component wishing to provide customers with their binaries will build and publish artifacts via an official channel to a central index.
Each component wishing to provide customers with their binaries will provide a ClusterCLI CR and will also provide a mechanism (controller)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know what this means?

Copy link
Contributor Author

@sallyom sallyom Dec 4, 2020

Choose a reason for hiding this comment

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

I'll clarify that. Maybe this is better
Each component wishing to provide customers with binaries will create a clustercli custom resource to provide an image name and the file path within that image for the binaries. Also a controller to manage that custom resource may be added (to at least ensure that CR exists? or not). The CLIs currently offered via console-cli-downloads will be included in the reference implementation of this enhancement . oc will gather clusterclis from the cluster, and also the fileserver will offer the binaries via the console by mounting the binaries from the location/image in each custom resource.

As a user, I want a CLI manager for various CLIs available for OpenShift and related services so that I can discover, install and list them
The user will invoke the following commands:

* `oc clustercli list` to view installed binaries
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not a fan of clustercli. Also, why do we need search? What is the difference between list and search?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we don't need search, i'll update

the crd name is currently clusterclis.config.openshift.io but the oc command can be whatever. clustercli captures the idea that these are clis offered from custom resources in a cluster, but it can be changed when i wire this into/create a new command for oc, haven't looked at that yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh list was to view the binaries installed on one's system (at a known or given location) while search is to list available CLIs from cluster.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's confusing though, don't need search, removing it

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JAORMX, soltysh

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

@sallyom
Copy link
Contributor Author

sallyom commented Feb 9, 2021

@smarterclayton ok to remove the hold on this and merge? As it's written now, this will be a mechanism to extract and un-compress supported clis from either the release payload or supported image registry to a designated location on a local system.

reviewers:
- "@soltysh"
approvers:
- "@soltysh"
Copy link

Choose a reason for hiding this comment

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

Please add @spadgett as an approver here.

I'm not sure I fully understood what or if there would be a migration path from the existing, console shipped resource to the other and if we're going to commit to supporting both for a time since we already have a published CRD for this. Or why we wouldn't just repurpose that resource with links pointing in cluster for anything not currently doing it. @spadgett will need to be involved with that.

(we're currently providing in-cluster downloads for each platform's oc client here right, Sam?)

Same for how we evolve the cli-downloads artifact we currently ship that supports those in-cluster downloads.

Overall I like the idea of shipping via images and providing it all in cluster to support the disconnected experience 👍

Copy link

Choose a reason for hiding this comment

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

/cc @jhadvig - console operator maintainer :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This has been on the back burner for quite awhile. I'll add a migration path, but yes, will be a seamless transition, and the CRD should be repurposed. The add is that for supported CLIs (those currently offered via cli-downloads) there will be an image (within release payload? as oc currently is) that will allow access to binaries from mirrored images if disconnected. I'll give this enhancement an update in the coming days, thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

might start out as a cli plugin w/ a configurable list of cli images. again, will give this some thought and update this proposal

Copy link

Choose a reason for hiding this comment

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

please keep in mind that we'll want a corresponding user experience via the console. Any logic you put in the plugin either needs to be in a sharable library or API or we'll end up having to duplicate the logic in the UI. Thanks!!


##### example:
```
$ oc clustercli list

Choose a reason for hiding this comment

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

I think that we need also a column showing what is the recommended version of the CLI to be used for the target cluster. That will help the users to figure out if they must upgrade some of their clients and to use the CLI matching the current cluster version.

How do you plan to check INSTALLED as that implies that you execute a command to check on the machine if the the CLI binary is present under by example $HOME/openshift/clients/cli1 ?

Will the user be informed that they must include a new path to access the CLIs (e.g $HOME/openshift/clients/) ?

Do you plan to support to install several versions of the same client or only one (easier to maintain) ?

How do you plan to set the UID/GROUPID of the user connected to the machine to define the correct owner (e.g. chown user1:group1 $HOME/openshift/clients/cli1) ?

The user will invoke the following commands:

* `oc clustercli list` will access the connected OpenShift cluster, if connected, and will retrieve information about available CLIs (clusterCLI CRs)
* `oc clustercli install odo` will install `odo` to a user's home directory, as a standalone binary.

Choose a reason for hiding this comment

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

That should be great to have a command such as oc clustercli install kubetools able to install the recommended tools: helm, kubectl, oc, odo, k9s, ... - WDYT ?

@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 1, 2021
@JAORMX
Copy link
Contributor

JAORMX commented Jul 12, 2021

Is this still to be implemented? We'd still like to integrate with this :)

@deboer-tim
Copy link

The OpenShift Tools Installer (https://github.com/redhat-actions/openshift-tools-installer) has shown it's possible to dynamically scan mirror & github to build a list of all the current clis and their download URLs by OS. I've been playing with this data since it seems like we should be able to automate or simplify this w/o requiring each tool to provide a custom image or contribute to an index. Likewise, the same tool could support offline/cluster-provided clis vs latest install.

@openshift-bot
Copy link

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci openshift-ci bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Aug 12, 2021
@jwmatthews
Copy link
Member

Interested to leverage this for OADP (OpenShift API for Data Protection) when it's available.

@sallyom
Copy link
Contributor Author

sallyom commented Sep 19, 2021

Interested to leverage this for OADP (OpenShift API for Data Protection) when it's available.

@jwmatthews I am working on a poc here, and will keep you updated: https://github.com/sallyom/clustercli I'm only now getting back to this. I'll be updating this and and the poc this week, stay tuned.

@openshift-bot
Copy link

Rotten enhancement proposals close after 7d of inactivity.

See https://github.com/openshift/enhancements#life-cycle for details.

Reopen the proposal by commenting /reopen.
Mark the proposal as fresh by commenting /remove-lifecycle rotten.
Exclude this proposal from closing again by commenting /lifecycle frozen.

/close

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 26, 2021

@openshift-bot: Closed this PR.

In response to this:

Rotten enhancement proposals close after 7d of inactivity.

See https://github.com/openshift/enhancements#life-cycle for details.

Reopen the proposal by commenting /reopen.
Mark the proposal as fresh by commenting /remove-lifecycle rotten.
Exclude this proposal from closing again by commenting /lifecycle frozen.

/close

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.

@openshift-ci openshift-ci bot closed this Sep 26, 2021
@jwmatthews
Copy link
Member

@sallyom I see this was closed recently, should the stale lifecycle be removed and this reopened?

@soltysh
Copy link

soltysh commented Sep 29, 2021

@sallyom I see this was closed recently, should the stale lifecycle be removed and this reopened?

@deejross is working on a new version of this enhancement

@soltysh soltysh mentioned this pull request Oct 15, 2021
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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. 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.