{"id":17457884,"url":"https://github.com/royling/ocp-console-plugin","last_synced_at":"2025-08-12T09:14:03.441Z","repository":{"id":163314580,"uuid":"638788925","full_name":"royling/ocp-console-plugin","owner":"royling","description":null,"archived":false,"fork":false,"pushed_at":"2023-05-10T05:36:48.000Z","size":164,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-02T05:55:02.647Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/royling.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-10T05:36:45.000Z","updated_at":"2023-05-10T05:38:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"4f18b308-a6c1-4445-bba4-683d1d2ea085","html_url":"https://github.com/royling/ocp-console-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"openshift/console-plugin-template","purl":"pkg:github/royling/ocp-console-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/royling%2Focp-console-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/royling%2Focp-console-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/royling%2Focp-console-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/royling%2Focp-console-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/royling","download_url":"https://codeload.github.com/royling/ocp-console-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/royling%2Focp-console-plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270034163,"owners_count":24515644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-18T03:23:59.659Z","updated_at":"2025-08-12T09:14:03.395Z","avatar_url":"https://github.com/royling.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenShift Console Plugin Template\n\nThis project is a minimal template for writing a new OpenShift Console dynamic\nplugin.\n\n[Dynamic plugins](https://github.com/openshift/console/tree/master/frontend/packages/console-dynamic-plugin-sdk)\nallow you to extend the\n[OpenShift UI](https://github.com/openshift/console)\nat runtime, adding custom pages and other extensions. They are based on\n[webpack module federation](https://webpack.js.org/concepts/module-federation/).\nPlugins are registered with console using the `ConsolePlugin` custom resource\nand enabled in the console operator config by a cluster administrator.\n\nUsing the latest `v1` API version of `ConsolePlugin` CRD, requires OpenShift 4.12\nand higher. For using old `v1alpha1` API version us OpenShift version 4.10 or 4.11.\n\nFor an example of a plugin that works with OpenShift 4.11, see the `release-4.11` branch.\nFor a plugin that works with OpenShift 4.10, see the `release-4.10` branch.\n\n[Node.js](https://nodejs.org/en/) and [yarn](https://yarnpkg.com) are required\nto build and run the example. To run OpenShift console in a container, either\n[Docker](https://www.docker.com) or [podman 3.2.0+](https://podman.io) and\n[oc](https://console.redhat.com/openshift/downloads) are required.\n\n## Getting started\n\nAfter cloning this repo, you should update the plugin metadata such as the\nplugin name in the `consolePlugin` declaration of [package.json](package.json).\n\n```json\n\"consolePlugin\": {\n  \"name\": \"my-plugin\",\n  \"version\": \"0.0.1\",\n  \"displayName\": \"My Plugin\",\n  \"description\": \"Enjoy this shiny, new console plugin!\",\n  \"exposedModules\": {\n    \"ExamplePage\": \"./components/ExamplePage\"\n  },\n  \"dependencies\": {\n    \"@console/pluginAPI\": \"*\"\n  }\n}\n```\n\nThe template adds a single example page in the Home navigation section. The\nextension is declared in the [console-extensions.json](console-extensions.json)\nfile and the React component is declared in\n[src/components/ExamplePage.tsx](src/components/ExamplePage.tsx).\n\nYou can run the plugin using a local development environment or build an image\nto deploy it to a cluster.\n\n## Development\n\n### Option 1: Local\n\nIn one terminal window, run:\n\n1. `yarn install`\n2. `yarn run start`\n\nIn another terminal window, run:\n\n1. `oc login` (requires [oc](https://console.redhat.com/openshift/downloads) and an [OpenShift cluster](https://console.redhat.com/openshift/create))\n2. `yarn run start-console` (requires [Docker](https://www.docker.com) or [podman 3.2.0+](https://podman.io))\n\nThis will run the OpenShift console in a container connected to the cluster\nyou've logged into. The plugin HTTP server runs on port 9001 with CORS enabled.\nNavigate to \u003chttp://localhost:9000/example\u003e to see the running plugin.\n\n#### Running start-console with Apple silicon and podman\n\nIf you are using podman on a Mac with Apple silicon, `yarn run start-console`\nmight fail since it runs an amd64 image. You can workaround the problem with\n[qemu-user-static](https://github.com/multiarch/qemu-user-static) by running\nthese commands:\n\n```bash\npodman machine ssh\nsudo -i\nrpm-ostree install qemu-user-static\nsystemctl reboot\n```\n\n### Option 2: Docker + VSCode Remote Container\n\nMake sure the\n[Remote Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)\nextension is installed. This method uses Docker Compose where one container is\nthe OpenShift console and the second container is the plugin. It requires that\nyou have access to an existing OpenShift cluster. After the initial build, the\ncached containers will help you start developing in seconds.\n\n1. Create a `dev.env` file inside the `.devcontainer` folder with the correct values for your cluster:\n\n```bash\nOC_PLUGIN_NAME=my-plugin\nOC_URL=https://api.example.com:6443\nOC_USER=kubeadmin\nOC_PASS=\u003cpassword\u003e\n```\n\n2. `(Ctrl+Shift+P) =\u003e Remote Containers: Open Folder in Container...`\n3. `yarn run start`\n4. Navigate to \u003chttp://localhost:9000/example\u003e\n\n## Docker image\n\nBefore you can deploy your plugin on a cluster, you must build an image and\npush it to an image registry.\n\n1. Build the image:\n\n   ```sh\n   docker build -t quay.io/my-repositroy/my-plugin:latest .\n   ```\n\n2. Run the image:\n\n   ```sh\n   docker run -it --rm -d -p 9001:80 quay.io/my-repository/my-plugin:latest\n   ```\n\n3. Push the image:\n\n   ```sh\n   docker push quay.io/my-repository/my-plugin:latest\n   ```\n\nNOTE: If you have a Mac with Apple silicon, you will need to add the flag\n`--platform=linux/amd64` when building the image to target the correct platform\nto run in-cluster.\n\n## Deployment on cluster\n\nA [Helm](https://helm.sh) chart is available to deploy the plugin to an OpenShift environment.\n\nThe following Helm parameters are required:\n\n`plugin.image`: The location of the image containing the plugin that was previously pushed\n\nAdditional parameters can be specified if desired. Consult the chart [values](charts/openshift-console-plugin/values.yaml) file for the full set of supported parameters.\n\n### Installing the Helm Chart\n\nInstall the chart using the name of the plugin as the Helm release name into a new namespace or an existing namespace as specified by the `my-plugin-namespace` parameter and providing the location of the image within the `plugin.image` parameter by using the following command:\n\n```shell\nhelm upgrade -i  my-plugin charts/openshift-console-plugin -n my-plugin-namespace --create-namespace --set plugin.image=my-plugin-image-location\n```\n\nNOTE: When deploying on OpenShift 4.10, it is recommended to add the parameter `--set plugin.securityContext.enabled=false` which will omit configurations related to Pod Security.\n\n## Linting\n\nThis project adds prettier, eslint, and stylelint. Linting can be run with\n`yarn run lint`.\n\nThe stylelint config disallows hex colors since these cause problems with dark\nmode (starting in OpenShift console 4.11). You should use the\n[PatternFly global CSS variables](https://patternfly-react-main.surge.sh/developer-resources/global-css-variables#global-css-variables)\nfor colors instead.\n\nThe stylelint config also disallows naked element selectors like `table` and\n`.pf-` or `.co-` prefixed classes. This prevents plugins from accidentally\noverwriting default console styles, breaking the layout of existing pages. The\nbest practice is to prefix your CSS classnames with your plugin name to avoid\nconflicts. Please don't disable these rules without understanding how they can\nbreak console styles!\n\n## Reporting\n\nSteps to generate reports\n\n1. In command prompt, navigate to root folder and execute the command `yarn run cypress-merge`\n2. Then execute command `yarn run cypress-generate`\nThe cypress-report.html file is generated and should be in (/integration-tests/screenshots) directory\n\n## References\n\n- [Console Plugin SDK README](https://github.com/openshift/console/tree/master/frontend/packages/console-dynamic-plugin-sdk)\n- [Customization Plugin Example](https://github.com/spadgett/console-customization-plugin)\n- [Dynamic Plugin Enhancement Proposal](https://github.com/openshift/enhancements/blob/master/enhancements/console/dynamic-plugins.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froyling%2Focp-console-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froyling%2Focp-console-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froyling%2Focp-console-plugin/lists"}