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

Update README and remove feature gates related to protocol request support once it lands in Lens #25

Closed
3 tasks
stefcameron opened this issue Dec 11, 2020 · 2 comments
Labels
tracking Tracking an issue in a remote repo
Milestone

Comments

@stefcameron
Copy link
Contributor

stefcameron commented Dec 11, 2020

This is the Lens issue tracking implementation: lensapp/lens#1288

Search the code for this issue here to find the places where things need a bit of refactoring to be made more "official".

For now, the feature gates should(tm) start working once Lens supports the feature.

  • Remove feature gates
  • Add info in the README about what type of requests are supported
  • Update version "4.1" to "4.2" in the "Links" text rendered in the right hand panel in the extension itself
@stefcameron stefcameron added the tracking Tracking an issue in a remote repo label Dec 11, 2020
@stefcameron
Copy link
Contributor Author

lensapp/lens#1288 will be in Lens 4.2 🎉

@stefcameron stefcameron modified the milestones: v3.0.0, v2.2.0 Apr 15, 2021
@stefcameron stefcameron changed the title Remove feature gates related to protocol request support once it lands in Lens Update README and remove feature gates related to protocol request support once it lands in Lens Apr 15, 2021
@stefcameron
Copy link
Contributor Author

README content to add to "Help" section:

### Supported protocol requests

[Lens 4.2](https://medium.com/k8slens/lens-4-2-released-f1c3268d3f95) introduced a new __custom Lens protocol handler__. This means Lens can now respond to `lens://` URL requests made in the browser, and this extension can now support some interesting requests that enable tighter integration between Mirantis Container Cloud instances and Lens.

> Note that this integration is a one-way street: Container Cloud -> Lens. It does not work the other way around. _Reverse_ integration is achieved simply by making Container Cloud API requests from Lens, which is much easier to achieve, and has been used by this extension since its inception.

The __base URL__ for requests that this extension can respond to is:

```
lens://extensions/@mirantis/lens-extension-cc
```

The following APIs are currently supported by this extension, from the base URL above:

#### Activate cluster

Activates a cluster __already added__ to Lens.

```
GET /activateCluster
  ?cloudUrl={string}
  &namespace={string}
  &clusterName={string}
  &clusterId={string}
```

- `cloudUrl`: URL to the instance, e.g. `https://container-cloud.my-company.com`
- `namespace`: ID of the Container Cloud namespace containing the cluster to activate.
- `clusterName`: Name of the cluster to activate.
- `clusterId`: ID of the cluster (in `namespace`) to activate.

#### Add one cluster

Adds a __single__ cluster to Lens (if it hasn't already been added) by providing a pre-configured kubeConfig JSON object for the cluster. As such, this endpoint does not require the extension to perform any authentication/authorization requests. It simply stores the kubeConfig on disk and tells Lens where to find it.

```
GET /kubeConfig
  ?cloudUrl={string}
  &namespace={string}
  &clusterName={string}
  &clusterId={string}
  &kubeConfig={string}
```

- `cloudUrl`: URL to the instance, e.g. `https://container-cloud.my-company.com`
- `namespace`: ID of the Container Cloud namespace containing the cluster to activate.
- `clusterName`: Name of the cluster to activate.
- `clusterId`: ID of the cluster (in `namespace`) to activate.
- `kubeConfig`: JSON-stringified, Base64-encoded kubeConfig payload.

#### Add multiple clusters

Allows the user to add __one or more__ clusters to Lens by telling the extension where to find them. Unlike [adding one cluster](#add-one-cluster), it does not automatically add any clusters to Lens. It simply triggers the extension to immediately list all available clusters, and then lets the user choose which ones to add.

```
GET /addClusters
  ?cloudUrl={string}
  &username={string}
  &tokens={string}
  [ &keycloakLogin={boolean} ]
  [ &namespaces={string} ]
```

- `cloudUrl`: URL to the instance, e.g. `https://container-cloud.my-company.com`
- `username`: Username associated with the `tokens`.
- `tokens`: JSON-stringified, Base64-encoded OAuth2 tokens for the user.
- `keycloakLogin` (Optional): `false` (default) if the instance in `cloudUrl` uses basic (username/password) authentication; `true` if the instance in `cloudUrl` uses SSO authorization.
- `namespaces` (Optional): Comma-delimited list of namespace IDs to restrict the list of clusters presented by the extension (i.e. a filter on namespaces). Only clusters in these namespaces will be listed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tracking Tracking an issue in a remote repo
Projects
None yet
Development

No branches or pull requests

1 participant