×

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.

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 OKD 4.17 or later.

Procedure
  1. To list all available plugins, run the following command:

    $ oc krew search
  2. To get information about a plugin, run the following command:

    $ oc krew info <plugin_name>
  3. To install a plugin, run the following command:

    $ oc krew install <plugin_name>
  4. To list all plugins that were installed by Krew, run the following command:

    $ oc krew list

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 OKD as a user with the cluster-admin role.

  • The CLI Manager Operator is installed.

  • The plugin you are upgrading is installed.

Procedure
  1. Using the CLI, enter the following command:

oc edit plugin/<plugin_name>
  1. 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.
  1. Save the file.

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

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>