Skip to content

Commit 2f6a046

Browse files
committed
OSDOCS-4073: Dynamic plug-in doc updates
1 parent 852496e commit 2f6a046

22 files changed

+1873
-816
lines changed

_topic_maps/_topic_map.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,8 +656,19 @@ Topics:
656656
File: customizing-the-web-console
657657
Distros: openshift-enterprise,openshift-origin
658658
- Name: Dynamic plug-ins
659-
File: dynamic-plug-ins
659+
Dir: dynamic-plug-in
660660
Distros: openshift-enterprise,openshift-origin
661+
Topics:
662+
- Name: Overview of dynamic plug-ins
663+
File: dynamic-plug-in
664+
- Name: Getting started with dynamic plug-ins
665+
File: dynamic-plug-ins-get-started
666+
- Name: Deploy your plug-in on a cluster
667+
File: deploy-plug-in-cluster
668+
- Name: Dynamic plug-in example
669+
File: dynamic-plug-in-example
670+
- Name: Dynamic plug-in reference
671+
File: dynamic-plug-ins-reference
661672
- Name: Web terminal
662673
File: odc-about-web-terminal
663674
Distros: openshift-enterprise,openshift-online

modules/adding-new-extension-dynamic-plug-in.adoc

Lines changed: 0 additions & 35 deletions
This file was deleted.

modules/adding-tab-pods-page.adoc

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,55 @@
11
// Module included in the following assemblies:
22
//
3-
// * web_console/dynamic-plug-ins.adoc
3+
// * web_console/dynamic-plugin-example.adoc
44

55
:_content-type: PROCEDURE
66
[id="adding-tab-to-pods-page_{context}"]
77
= 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+
====
915

1016
.Procedure
1117

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+
1253
. Add the following to the `console-extensions.json` file:
1354
+
1455
[source,json]
@@ -57,4 +98,4 @@ export default function ExampleTab() {
5798
----
5899

59100
.Verification
60-
* Visit a *Pod* page to view the added tab.
101+
* Visit a *Pod* page to view the added tab.

modules/build-image-docker.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Module included in the following assemblies:
22
//
3-
// * web_console/dynamic-plug-ins.adoc
3+
// * web_console/deploy-plug-in-cluster.adoc
44

55
:_content-type: PROCEDURE
66
[id="build-image-with-docker_{context}"]
Lines changed: 75 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Module included in the following assemblies:
22
//
3-
// * web_console/dynamic-plug-ins.adoc
3+
// * web_console/deploy-plug-in-cluster.adoc
44

55
:_content-type: PROCEDURE
66
[id="deploy-on-cluster_{context}"]
@@ -10,32 +10,86 @@ After pushing an image with your changes to a registry, you can deploy the plug-
1010

1111
.Procedure
1212

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:
14+
1415
+
1516
[source,terminal]
1617
----
17-
$ oc process -f template.yaml \
18-
-p PLUGIN_NAME=my-plugin \ <1>
19-
-p NAMESPACE=my-plugin-namespace \ <2>
20-
-p IMAGE=quay.io/my-repository/my-plugin:latest \ <3>
21-
| oc create -f -
18+
$ helm upgrade -i my-plugin charts/openshift-console-plugin -n my-plugin-namespace --create-namespace --set plugin.image=my-plugin-image-location
2219
----
23-
<1> Update with the name of your plug-in.
24-
<2> Update with the namespace.
25-
<3> Update with the name of the image you created.
2620
+
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:
3622
+
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+
--
3828

29+
. Optional: You can specify any additional parameters by using the set of supported parameters in the `charts/openshift-console-plugin/values.yaml` file.
30+
31+
[source,yaml]
3932
----
40-
$ oc patch consoles.operator.openshift.io cluster --patch '{ "spec": { "plugins": ["my-plugin"] } }' --type=merge
33+
plugin:
34+
name: ""
35+
description: ""
36+
image: ""
37+
imagePullPolicy: IfNotPresent
38+
replicas: 2
39+
port: 9443
40+
securityContext:
41+
enabled: true
42+
podSecurityContext:
43+
enabled: true
44+
runAsNonRoot: true
45+
seccompProfile:
46+
type: RuntimeDefault
47+
containerSecurityContext:
48+
enabled: true
49+
allowPrivilegeEscalation: false
50+
capabilities:
51+
drop:
52+
- ALL
53+
resources:
54+
requests:
55+
cpu: 10m
56+
memory: 50Mi
57+
basePath: /
58+
certificateSecretName: ""
59+
serviceAccount:
60+
create: true
61+
annotations: {}
62+
name: ""
63+
patcherServiceAccount:
64+
create: true
65+
annotations: {}
66+
name: ""
67+
jobs:
68+
patchConsoles:
69+
enabled: true
70+
image: "registry.redhat.io/openshift4/ose-tools-rhel8@sha256:e44074f21e0cca6464e50cb6ff934747e0bd11162ea01d522433a1a1ae116103"
71+
podSecurityContext:
72+
enabled: true
73+
runAsNonRoot: true
74+
seccompProfile:
75+
type: RuntimeDefault
76+
containerSecurityContext:
77+
enabled: true
78+
allowPrivilegeEscalation: false
79+
capabilities:
80+
drop:
81+
- ALL
82+
resources:
83+
requests:
84+
cpu: 10m
85+
memory: 50Mi
4186
----
87+
88+
.Verification
89+
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.
95+
====

modules/disabling-plug-in-browser.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Module included in the following assemblies:
22
//
3-
// * web_console/dynamic-plug-ins.adoc
3+
// * web_console/deploy-plug-in-cluster.adoc
44

55
:_content-type: PROCEDURE
66
[id="disabling-your-plug-in-browser_{context}"]

0 commit comments

Comments
 (0)