Skip to content

Commit c57e082

Browse files
authored
Merge pull request #111266 from jseseCCS/OSDOCS-19549
OSDOCS-19549: Instructions to enable plugins sans UI
2 parents d3203ec + 4032cb7 commit c57e082

2 files changed

Lines changed: 103 additions & 0 deletions

File tree

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
//Used in assembly deploy-plugin-cluster.adoc
2+
3+
:_mod-docs-content-type: PROCEDURE
4+
[id="enabling-a-dynamic-plugin-by-using-the-cli_{context}"]
5+
= Enabling a dynamic plugin with the CLI
6+
7+
[role="_abstract"]
8+
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 {oc-first} 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.
9+
10+
.Prerequisites
11+
* You logged in to the cluster as a user with `cluster-admin` privileges.
12+
* You installed the dynamic plugin using a scripted installation, such as an Operator or Helm chart.
13+
* A `ConsolePlugin` custom resource (CR) exists on the cluster.
14+
15+
.Procedure
16+
. Confirm the name of the `ConsolePlugin` resource by running the following command:
17+
+
18+
[source,terminal]
19+
----
20+
$ oc get consoleplugin
21+
----
22+
+
23+
. Optional: View details for a specific `ConsolePlugin` resource by running the following commands:
24+
25+
.. Set the plugin name as an environment variable:
26+
+
27+
[source,terminal]
28+
----
29+
$ PLUGIN_NAME="<plugin_name>"
30+
----
31+
+
32+
where `<plugin_name>` is the name of the `ConsolePlugin` resource.
33+
.. Verify the plugin details:
34+
+
35+
[source,terminal]
36+
----
37+
$ oc get consoleplugin "${PLUGIN_NAME}" -o yaml
38+
----
39+
+
40+
The following example shows a `ConsolePlugin` YAML with the plugin listed in `spec.plugins`:
41+
+
42+
[source,yaml]
43+
----
44+
apiVersion: operator.openshift.io/v1
45+
kind: Console
46+
metadata:
47+
name: cluster
48+
spec:
49+
plugins:
50+
- <plugin_name>
51+
# ...
52+
----
53+
+
54+
Replace `<plugin_name>` with the name of your plugin.
55+
56+
. Enable the dynamic plugin by adding the `ConsolePlugin` name to the console Operator configuration.
57+
+
58+
[NOTE]
59+
====
60+
Make sure the Operator finishes installing the dynamic plugin before you run the following patch command.
61+
====
62+
+
63+
.. Set the plugin patch as an environment variable:
64+
+
65+
[source,terminal]
66+
----
67+
$ PLUGIN_PATCH=$(cat <<EOF
68+
[
69+
{
70+
"op": "add",
71+
"path": "/spec/plugins/-",
72+
"value": "<plugin_name>"
73+
}
74+
]
75+
EOF
76+
)
77+
----
78+
79+
.. Patch the console Operator configuration:
80+
+
81+
[source,terminal]
82+
----
83+
$ oc patch consoles.operator.openshift.io cluster --type=json -p "${PLUGIN_PATCH}"
84+
----
85+
86+
.Verification
87+
. Confirm that the console Operator configuration includes the `ConsolePlugin` name by running the following command:
88+
+
89+
[source,terminal]
90+
----
91+
$ oc get console.operator.openshift.io cluster -o jsonpath='{.spec.plugins}{"\n"}'
92+
----
93+
94+
. Refresh the {product-title} web console.
95+
+
96+
The console can take a few minutes to apply the updated configuration.
97+
98+
[role="_additional-resources"]
99+
.Additional resources
100+
* https://github.com/openshift/console/tree/main/dynamic-demo-plugin#enabling-the-plugin[Upstream demo instructions for enabling a plugin]
101+
* https://github.com/openshift/console-plugin-template/blob/3a06152cffdd10ad9654b6b607cb00a055f29733/charts/openshift-console-plugin/templates/patch-consoles-job.yaml[Helm template that patches the console Operator configuration]

web_console/dynamic-plugin/deploy-plugin-cluster.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ include::modules/deployment-plug-in-cluster.adoc[leveloffset=+1]
2424

2525
include::modules/dynamic-plugin-proxy-service.adoc[leveloffset=+1]
2626

27+
include::modules/proc_enabling-dynamic-plugin-using-cli.adoc[leveloffset=+1]
28+
2729
ifndef::openshift-rosa,openshift-dedicated,openshift-rosa-hcp[]
2830
[role="_additional-resources"]
2931
.Additional resources

0 commit comments

Comments
 (0)