Skip to content

Commit 7178b4a

Browse files
committed
OCPBUGS#32312: Adds missing mentions of service proxy in dynamic plugin docs
1 parent ec3fd68 commit 7178b4a

File tree

3 files changed

+58
-1
lines changed

3 files changed

+58
-1
lines changed

modules/dynamic-plugin-api.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
:_mod-docs-content-type: REFERENCE
99
[id="dynamic-plugin-api_{context}"]
10-
= {product-title} console API
10+
= Dynamic plugin API
1111

1212
[discrete]
1313
== `useActivePerspective`
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * web_console/dynamic-plugin/deploy-plugin-cluster.adoc
4+
5+
:_mod-docs-content-type: CONCEPT
6+
[id="dynamic-plugin-proxy-service_{context}"]
7+
= Plugin service proxy
8+
9+
If you need to make HTTP requests to an in-cluster service from your plugin, you can declare a service proxy in its `ConsolePlugin` resource by using the `spec.proxy` array field. The console backend exposes the `/api/proxy/plugin/<plugin-name>/<proxy-alias>/<request-path>++?++<optional-query-parameters>` endpoint to proxy the communication between the plugin and the service. A proxied request uses a _service CA bundle_ by default. The service must use HTTPS.
10+
11+
[NOTE]
12+
====
13+
The plugin must use the `consolefetch` API to make requests from its JavaScript code or some requests might fail. For more information, see "Dynamic plugin API".
14+
====
15+
16+
For each entry, you must specify an endpoint and alias of the proxy under the `endpoint` and `alias` fields. For the Service proxy type, you must set the endpoint `type` field to `Service` and the `service` must include values for the `name`, `namespace`, and `port` fields. For example, `/api/proxy/plugin/helm/helm-charts/releases++?++limit++=++10` is a proxy request path from the `helm` plugin with a `helm-charts` service that lists ten helm releases.
17+
18+
.Example service proxy
19+
[source,YAML,subs="+quotes,+macros"]
20+
----
21+
apiVersion: console.openshift.io/v1
22+
kind: ConsolePlugin
23+
metadata:
24+
name:<plugin-name>
25+
spec:
26+
proxy:
27+
- alias: helm-charts <1>
28+
authorization: UserToken <2>
29+
caCertificate: +'-----BEGIN CERTIFICATE-----\nMIID....'en+ <3>
30+
endpoint: <4>
31+
service:
32+
name: <service-name>
33+
namespace: <service-namespace>
34+
port: <service-port>
35+
type: Service
36+
----
37+
<1> Alias of the proxy.
38+
<2> If the service proxy request must contain the logged-in user's {product-title} access token, you must set the authorization field to `UserToken`.
39+
+
40+
[NOTE]
41+
====
42+
If the service proxy request does not contain the logged-in user's {product-title} access token, set the authorization field to `None`.
43+
====
44+
<3> If the service uses a custom service CA, the `caCertificate` field must contain the certificate bundle.
45+
<4> Endpoint of the proxy.

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,23 @@ include::modules/build-image-docker.adoc[leveloffset=+1]
1212

1313
include::modules/deployment-plug-in-cluster.adoc[leveloffset=+1]
1414

15+
include::modules/dynamic-plugin-proxy-service.adoc[leveloffset=+1]
16+
17+
ifndef::openshift-rosa,openshift-dedicated[]
18+
[role="_additional-resources"]
19+
.Additional resources
20+
21+
* xref:../../security/certificate_types_descriptions/service-ca-certificates.adoc#service-ca-certificates[Service CA certificates]
22+
* xref:../../security/certificates/service-serving-certificate.adoc#service-serving-certificate[Securing service traffic using service serving certificate secrets]
23+
* xref:../../web_console/dynamic-plugin/dynamic-plugins-reference.adoc#dynamic-plugin-api_dynamic-plugins-reference[Dynamic plugin API]
24+
endif::openshift-rosa,openshift-dedicated[]
25+
1526
include::modules/disabling-plug-in-browser.adoc[leveloffset=+1]
1627
1728
ifndef::openshift-rosa,openshift-dedicated[]
1829
[role="_additional-resources"]
1930
[id="dynamic-plugins_additional-resources"]
2031
== Additional resources
32+
2133
* xref:../../applications/working_with_helm_charts/understanding-helm.adoc#understaning-helm[Understanding Helm]
2234
endif::openshift-rosa,openshift-dedicated[]

0 commit comments

Comments
 (0)