You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/adding-tab-pods-page.adoc
+44-3Lines changed: 44 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,55 @@
1
1
// Module included in the following assemblies:
2
2
//
3
-
// * web_console/dynamic-plug-ins.adoc
3
+
// * web_console/dynamic-plugin-example.adoc
4
4
5
5
:_content-type: PROCEDURE
6
6
[id="adding-tab-to-pods-page_{context}"]
7
7
= Adding a tab to the pods page
8
-
The following procedure adds a tab to the *Pod Details* page as an example extension to your plug-in.
8
+
9
+
There are different customizations you can make to the {product-title} web console. The following procedure adds a tab to the *Pod details* page as an example extension to your plug-in.
10
+
11
+
[NOTE]
12
+
====
13
+
The {product-title} web console runs in a container connected to the cluster you have logged into. See "Dynamic plug-in development" for information to test the plug-in before creating your own.
14
+
====
9
15
10
16
.Procedure
11
17
18
+
. Visit the link:https://github.com/openshift/console-plugin-template[`console-plugin-template`] repository containing a template for creating plug-ins in a new tab.
19
+
+
20
+
[IMPORTANT]
21
+
====
22
+
Custom plug-in code is not supported by Red Hat. Only link:https://access.redhat.com/solutions/5893251[Cooperative community support] is available for your plug-in.
23
+
====
24
+
25
+
. Select the *Use this template* dropdown button and select *_Create new repository_* from the dropdown list to create a GitHub repository.
26
+
27
+
. Re-name the new repository with the name of your plug-in.
28
+
29
+
. Clone your copied repositury to your local machine so you can edit the code.
30
+
31
+
. Edit the plug-in metadata in the `consolePlugin` declaration of `package.json`.
32
+
+
33
+
[source,json]
34
+
----
35
+
"consolePlugin": {
36
+
"name": "my-plugin", <1>
37
+
"version": "0.0.1", <2>
38
+
"displayName": "My Plugin", <3>
39
+
"description": "Enjoy this shiny, new console plugin!", <4>
40
+
"exposedModules": {
41
+
"ExamplePage": "./components/ExamplePage"
42
+
},
43
+
"dependencies": {
44
+
"@console/pluginAPI": "/*"
45
+
}
46
+
}
47
+
----
48
+
<1> Update the name of your plug-in.
49
+
<2> Update the version.
50
+
<3> Update the display name for your plug-in.
51
+
<4> Update the description with a synopsis about your plug-in.
52
+
12
53
. Add the following to the `console-extensions.json` file:
13
54
+
14
55
[source,json]
@@ -57,4 +98,4 @@ export default function ExampleTab() {
@@ -10,32 +10,86 @@ After pushing an image with your changes to a registry, you can deploy the plug-
10
10
11
11
.Procedure
12
12
13
-
. To deploy your plug-in to a cluster, instantiate your plug-in by running the following command:
13
+
. To deploy your plug-in to a cluster, install a Helm chart with the name of the plug-in as the Helm release name into a new namespace or an existing namespace as specified by the `-n` command-line option. Provide the location of the image within the `plugin.image` parameter by using the following command:
<3> Update with the name of the image you created.
26
20
+
27
-
This command runs a light-weight NGINX HTTP server to serve the assets for your plug-in.
28
-
29
-
[IMPORTANT]
30
-
====
31
-
`PLUGIN_NAME` must match the plug-in name you used in the `consolePlugin` declaration of `package.json`.
32
-
====
33
-
34
-
[start=2]
35
-
. Patch the *Console Operator* configuration to enable the plug-in by running the following command:
21
+
Where:
36
22
+
37
-
[source,terminal]
23
+
--
24
+
`n <my-plugin-namespace>`:: Specifies an existing namespace to deploy your plug-in into.
25
+
`--create-namespace`:: Optional: If deploying to a new namespace, use this parameter.
26
+
`--set plugin.image=my-plugin-image-location`:: Specifies the location of the image within the `plugin.image` parameter.
27
+
--
38
28
29
+
. Optional: You can specify any additional parameters by using the set of supported parameters in the `charts/openshift-console-plugin/values.yaml` file.
You can see the list of the enabled plugins on the *Overview* page or by navigating from *Administration*->*Cluster Settings*->*Configuration*->*Console*`operator.openshift.io`->*Console plugins*.
90
+
91
+
92
+
[NOTE]
93
+
====
94
+
It can take a few minutes for the new plug-in configuration to appear. If you do not see your plug-in, you might need to refresh your browser if the plugin was recently enabled. If you recieve any errors at runtime, check the JS console in browser developer tools to look for any errors in your plugin code.
0 commit comments