Getting started with dynamic plugins
To get started using the dynamic plugin, you must set up your environment to write a new OpenShift Container Platform dynamic plugin.
Dynamic plugin development
You can run the plugin by using a local development environment. The OpenShift Container Platform web console runs in a container connected to the cluster you have logged into.
Prerequisites
- You must have cloned the
console-plugin-templaterepository, which contains a template for creating plugins.ImportantRed Hat does not support custom plugin code. Only Cooperative community support is available for your plugin.
- You must have an OpenShift Container Platform cluster running.
- You must have the OpenShift CLI (
oc) installed. - You must have
yarninstalled. - You must have Docker v3.2.0 or later or Podman v3.2.0 or later installed and running.
Procedure
- Open two terminal windows.
- In one terminal window, run the following command to install the dependencies for your plugin using yarn.terminal
$ yarn install - After installing, run the following command to start yarn.terminal
$ yarn run start - In another terminal window, login to the OpenShift Container Platform web console through the CLI.terminal
$ oc login - Run the OpenShift Container Platform web console in a container connected to the cluster you have logged in to by running the following command:terminal
$ yarn run start-consoleNoteThe
yarn run start-consolecommand runs anamd64image and might fail when run with Apple Silicon and Podman. You can work around it withqemu-user-staticby running the following commands:terminal$ podman machine sshterminal$ sudo -iterminal$ rpm-ostree install qemu-user-staticterminal$ systemctl reboot
Verification
- Visit localhost:9000 to view the running plugin. Inspect the value of
window.SERVER_FLAGS.consolePluginsto see the list of plugins which load at runtime.