Enable a dynamic plugin with the CLI
You can enable a dynamic plugin to extend the core web console with more features, such as additional pages, perspectives, or dashboard items. Use the OpenShift CLI (oc) after a scripted installation, such as an Operator or Helm-based install. Add the ConsolePlugin name to spec.plugins in the console Operator configuration (console.operator.openshift.io/cluster) so the web console loads it.
-
You logged in to the cluster as a user with
cluster-adminprivileges. -
You installed the dynamic plugin using a scripted installation, such as an Operator or Helm chart.
-
A
ConsolePlugincustom resource (CR) exists on the cluster.
-
Confirm the name of the
ConsolePluginresource by running the following command:$ oc get consoleplugin -
Optional: View details for a specific
ConsolePluginresource by running the following commands:-
Set the plugin name as an environment variable:
$ PLUGIN_NAME="<plugin_name>"where
<plugin_name>is the name of theConsolePluginresource. -
Verify the plugin details:
$ oc get consoleplugin "${PLUGIN_NAME}" -o yamlThe following example shows a
ConsolePluginYAML with the plugin listed inspec.plugins:apiVersion: operator.openshift.io/v1 kind: Console metadata: name: cluster spec: plugins: - <plugin_name> # ...Replace
<plugin_name>with the name of your plugin.
-
-
Enable the dynamic plugin by adding the
ConsolePluginname to the console Operator configuration.Make sure the Operator finishes installing the dynamic plugin before you run the following patch command.
-
Set the plugin patch as an environment variable:
$ PLUGIN_PATCH=$(cat <<EOF [ { "op": "add", "path": "/spec/plugins/-", "value": "<plugin_name>" } ] EOF ) -
Patch the console Operator configuration:
$ oc patch consoles.operator.openshift.io cluster --type=json -p "${PLUGIN_PATCH}"
-
-
Confirm that the console Operator configuration includes the
ConsolePluginname by running the following command:$ oc get console.operator.openshift.io cluster -o jsonpath='{.spec.plugins}{"\n"}' -
Refresh the Red Hat OpenShift Container Platform web console.
The console can take a few minutes to apply the updated configuration.