Este conteúdo não está disponível no idioma selecionado.
Chapter 3. OpenShift CLI Manager
3.1. CLI Manager Operator overview
Using the CLI Manager Operator to install and manage plugins for the OpenShift CLI is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
3.1.1. About the CLI Manager Operator
The CLI Manager Operator makes it easier to install and update CLI plugins. It runs in both connected and disconnected environments, and it is particularly useful in disconnected environments. Cluster administrators can add CLI plugins and plugin updates to the CLI Manager Operator, and users can then install and update CLI plugins when needed regardless of whether or not the environment is disconnected.
3.2. CLI Manager Operator release notes
With the CLI Manager Operator, you can install CLI plugins in both connected and disconnected environments.
Using the CLI Manager Operator to install and manage plugins for the OpenShift CLI is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
These release notes track the development of the CLI Manager Operator for OpenShift Container Platform.
For more information about the CLI Manager Operator, see About the CLI Manager Operator.
3.2.1. CLI Manager Operator 0.1.0 (Technology Preview)
Issued: 19 November 2024
The following advisory is available for the CLI Manager Operator 0.1.0:
3.2.1.1. New features and enhancements
- This version is the initial Technology Preview release of the CLI Manager Operator. For installation information, see Installing the CLI Manager Operator.
3.3. Installing the CLI Manager Operator
You can run the CLI Manager Operator in both connected and disconnected environments. In particular, it eases the installation and management of CLI plugins in disconnected environments. The CLI Manager Operator makes Krew compatible with the oc
CLI. Cluster administrators can use the CLI Manager Operator to add CLI plugin custom resources that can then be accessed in both connected and disconnected environments. Cluster administrators install and configure the CLI Manager Operator, and users then add the custom index to Krew and add CLI plugins to the CLI Manager Operator.
Using the CLI Manager Operator to install and manage plugins for the OpenShift CLI is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
3.3.1. Installing the CLI Manager Operator
Install the CLI Manager Operator to facilitate adding CLI plugins in both connected and disconnected environments.
Prerequisites
- Krew is installed.
-
You are logged in to OpenShift Container Platform as a user with the
cluster-admin
role. - You have access to the OpenShift Container Platform web console.
Procedure
- Log in to the OpenShift Container Platform web console.
Create the required namespace for the CLI Manager Operator:
-
Navigate to Administration
Namespaces and click Create Namespace. -
In the Name field, enter
openshift-cli-manager-operator
and click Create.
-
Navigate to Administration
Install the CLI Manager Operator:
-
Navigate to Operators
OperatorHub. - In the filter box, enter CLI Manager Operator.
- Select the CLI Manager Operator and click Install.
On the Install Operator page, complete the following steps:
- Ensure that the Update channel is set to tech preview, which installs the latest Technology Preview release of the CLI Manager Operator.
- From the drop-down menu, select A specific namespace on the cluster and select openshift-cli-manager-operator.
- Click Install.
-
Navigate to Operators
Create the
CliManager
resource by completing the following steps:- Navigate to Installed Operators.
- Select CLI Manager Operator.
- Select the CLI Manager tab.
- Click Create CliManager.
- Use the default Name.
Click Create.
-
The new
CliManager
resource is listed in the CLI Manager tab.
-
The new
Verification
-
Navigate to Operators
Installed Operators. - Verify that CLI Manager Operator is listed with a Status of Succeeded.
3.3.2. Adding the CLI Manager Operator custom index to Krew
You can use the terminal to add the CLI manager custom index to Krew. This procedure is required for the CLI Manager Operator to function correctly and needs to be done only once.
The custom index connects Krew to the CLI Manager Operator binaries and enables the CLI Manager Operator to work in disconnected environments.
If you use self-signed certificates, mark the certificate as trusted on your local operating system to use Krew.
Prerequisites
- Krew is installed.
- The CLI Manager Operator is installed.
Procedure
To establish the
ROUTE
variable, enter the following command:$ ROUTE=$(oc get route/openshift-cli-manager -n openshift-cli-manager-operator -o=jsonpath='{.spec.host}')
To add the custom index to Krew, enter the following command:
$ oc krew index add <custom_index_name> https://$ROUTE/cli-manager
To update Krew, enter the following command and check for any errors:
$ oc krew update
Example output
Updated the local copy of plugin index. Updated the local copy of plugin index <custom_index_name>. New plugins available: * ocp/<plugin_name>
3.3.3. Adding a plugin to the CLI Manager Operator
You can add a CLI plugin to the CLI Manager Operator by using the YAML View.
Prerequisites
-
You are logged in to OpenShift Container Platform as a user with the
cluster-admin
role. - The CLI Manager Operator is installed.
Procedure
- Log in to the OpenShift Container Platform web console.
-
Navigate to Operators
Installed Operators. - From the list, select CLI Manager Operator.
- Select the CLI Plugin tab.
- Click Create Plugin.
In the text box, enter the information for the plugin you are installing. See the following example YAML file.
Example YAML file to add a plugin
apiVersion: config.openshift.io/v1alpha1 kind: Plugin metadata: name: <plugin_name> 1 spec: description: <description_of_plugin> homepage: <plugin_homepage> platforms: - bin: 2 files: - from: <plugin_file_path> to: . image: <plugin_image> imagePullSecret: 3 platform: <platform> 4 shortDescription: <short_description_of_plugin> version: <version> 5
- 1
- The name of the plugin you plan to use in commands.
- 2
Bin
specifies the path to the plugin executable.- 3
- Optional: If the registry is not public, add a pull secret to access your plugin image.
- 4
- Add the architecture for your system; for example,
linux/amd64
,darwin/arm64
,windows/amd64
, or another architecture. - 5
- Version must be in v0.0.0 format.
- Click Save.
Verification
- Enter the following command to see if the plugin is listed and has been added successfully:
$ oc get plugin/<plugin_name> -o yaml
Example output
<plugin_name> ready to be served.
3.4. Using the CLI Manager Operator
After the cluster administrator sets up and configures the CLI Manager Operator, users can use it to install, update, and uninstall CLI plugins.
Using the CLI Manager Operator to install and manage plugins for the OpenShift CLI is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
3.4.1. Installing CLI plugins with the CLI Manager Operator
You can install CLI plugins using the CLI Manager Operator.
Prerequisites
- You have installed Krew by following the installation procedure in the Krew documentation.
- The CLI Manager is installed.
- The CLI Manager custom index has been added to Krew.
- You are using OpenShift Container Platform 4.17 or later.
Procedure
To list all available plugins, run the following command:
$ oc krew search
To get information about a plugin, run the following command:
$ oc krew info <plugin_name>
To install a plugin, run the following command:
$ oc krew install <plugin_name>
To list all plugins that were installed by Krew, run the following command:
$ oc krew list
3.4.2. Upgrading a plugin with the CLI Manager Operator
You can upgrade a CLI plugin to a newer version with the CLI Manager Operator.
Prerequisites
-
You are logged in to OpenShift Container Platform as a user with the
cluster-admin
role. - The CLI Manager Operator is installed.
- The plugin you are upgrading is installed.
Procedure
- Using the CLI, enter the following command:
oc edit plugin/<plugin_name>
- Edit the YAML file to include the new specifications for your plugin.
Example YAML file to upgrade a plugin
apiVersion: config.openshift.io/v1alpha1 kind: Plugin metadata: name: <plugin_name> 1 spec: description: <description_of_plugin> homepage: <plugin_homepage> platforms: - bin: 2 files: - from: <plugin_file_path> to: . image: <plugin_image> imagePullSecret: 3 platform: <platform> 4 shortDescription: <short_description_of_plugin> version: <version> 5
- 1
- The name of the plugin you plan to use in commands.
- 2
Bin
specifies the path to the plugin executable.- 3
- Optional: If the registry is not public, add a pull secret to access your plugin image.
- 4
- Add the architecture for your system platform; for example,
linux/amd64
,darwin/arm64
,windows/amd64
, or another architecture. - 5
- Version of the plugin, in v0.0.0 format.
- Save the file.
3.4.3. Updating CLI plugins with the CLI Manager Operator
You can update a plugin that was installed for the OpenShift CLI (oc
) with the CLI Manager Operator.
Prerequisites
- You have installed Krew by following the installation procedure in the Krew documentation.
- The CLI Manager Operator is installed.
- The custom index has been added to Krew by the cluster administrator.
- The plugin updates have been added to the CLI Manager Operator by the cluster administrator.
- The plugin you are updating is already installed.
Procedure
To update a single plugin, run the following command:
$ oc krew upgrade <plugin_name>
To update all plugins that were installed by Krew, run the following command:
$ oc krew upgrade
3.4.4. Uninstalling a CLI plugin with the CLI Manager Operator
You can uninstall a plugin that was installed for the OpenShift CLI (oc
) with the CLI Manager Operator.
Prerequisites
- You have installed Krew by following the installation procedure in the Krew documentation.
- You have installed a plugin for the OpenShift CLI with the CLI Manager Operator.
Procedure
To uninstall a plugin, run the following command:
$ oc krew uninstall <plugin_name>
3.5. Uninstalling the CLI Manager Operator
You can remove the CLI Manager Operator from OpenShift Container Platform by uninstalling the CLI Manager Operator and removing its related resources.
Using the CLI Manager Operator to install and manage plugins for the OpenShift CLI is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
3.5.1. Uninstalling the CLI Manager Operator
You can uninstall the CLI Manager Operator by using the web console.
Prerequisites
-
You are logged in to OpenShift Container Platform as a user with the
cluster-admin
role. - You have access to the OpenShift Container Platform web console.
- The CLI Manager Operator is installed.
Procedure
- Log in to the OpenShift Container Platform web console.
Uninstall the CLI Manager Operator by completing the following steps:
-
Navigate to Operators
Installed Operators. - Click the Options menu next to the CLI Manager Operator entry and click Uninstall Operator.
- In the confirmation dialog, click Uninstall.
-
Navigate to Operators
3.5.2. Removing CLI Manager Operator resources
Optionally, after you uninstall the CLI Manager Operator, you can remove its related resources from your cluster.
Prerequisites
-
You are logged in to OpenShift Container Platform as a user with the
cluster-admin
role. - You have access to the OpenShift Container Platform web console.
Procedure
- Log in to the OpenShift Container Platform web console.
Remove the
openshift-cli-manager-operator
namespace:-
Navigate to Administration
Namespaces. - Click the Options menu next to the openshift-cli-manager-operator entry and select Delete Namespace.
-
In the confirmation dialog, enter
openshift-cli-manager-operator
in the field and click Delete.
-
Navigate to Administration