Skip to content

Commit d857427

Browse files
authored
Merge pull request #33762 from neal-timpe/ossmdoc-330
OSSMDOC-330: Extensions update
2 parents 3e0b573 + a9b9e61 commit d857427

File tree

3 files changed

+71
-39
lines changed

3 files changed

+71
-39
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[id="ossm-extensions-deploy_{context}"]
2+
= Deploying extensions
3+
4+
{ProductName} extensions can be enabled using the `ServiceMeshExtension` resource.
5+
6+
.Procedure
7+
8+
. Create the following example resource:
9+
+
10+
.Example ServiceMeshExtension resource extension.yaml
11+
[source,yaml]
12+
----
13+
apiVersion: maistra.io/v1alpha1
14+
kind: ServiceMeshExtension
15+
metadata:
16+
name: header-append
17+
namespace: istio-system
18+
spec:
19+
workloadSelector:
20+
labels:
21+
app: httpbin
22+
config: test
23+
image: quay.io/maistra-dev/header-append-filter:2.0
24+
phase: PostAuthZ
25+
priority: 100
26+
----
27+
28+
. Apply the `extension.yaml` file with the following command:
29+
+
30+
[source,terminal]
31+
----
32+
$ oc apply -f extension.yaml
33+
----
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[id="ossm-extensions-support_{context}"]
2+
= Enabling WebAssembly extension support
3+
4+
Support for WebAssembly extensions to {ProductName} is currently in link:https://access.redhat.com/support/offerings/techpreview[Technology Preview], so it must be explicitly enabled for your `ServiceMeshControlPlane`.
5+
6+
.Procedure
7+
8+
. In the {product-title} web console, click *Operators* -> *Installed Operators*.
9+
10+
. From the *Project* menu, select the project where you installed the control plane, for example `istio-system`.
11+
12+
. Click the {ProductName} Operator. In the *Istio Service Mesh Control Plane* column, click the name of your `ServiceMeshControlPlane` resource, for example `basic`.
13+
14+
. Click the *YAML* tab.
15+
16+
. Set `spec.techPreview.wasmExtensions.enabled` in your `ServiceMeshControlPlane` resource to `true`. For example:
17+
+
18+
[source,yaml]
19+
----
20+
apiVersion: maistra.io/v2
21+
kind: ServiceMeshControlPlane
22+
metadata:
23+
name: openid-connect
24+
namespace: istio-system
25+
spec:
26+
techPreview:
27+
wasmExtensions:
28+
enabled: true
29+
----
30+
31+
. Click *Save*.
32+
33+
. Click *Reload* to verify the `ServiceMeshControlPlane` resource was configured correctly.

service_mesh/v2x/ossm-extensions.adoc

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ priority: 100
6363
module: extension.wasm
6464
----
6565

66-
.manifest.yml Field Reference
66+
.Field Reference for manifest.yml
6767
|===
6868
| Field | Description
6969

@@ -91,45 +91,11 @@ module: extension.wasm
9191

9292
=== Example Rust extension
9393

94-
For a complete example that was built using the Rust SDK, take a look at the link:https://github.com/maistra/header-append-filter[header-append-filter]. It is a very simple filter that appends a header, `custom-header`, to all responses, with the value depending on its configuration.
94+
For a complete example that was built using the Rust SDK, take a look at the link:https://github.com/maistra/header-append-filter[header-append-filter]. The filter appends a header, called `custom-header`, to all responses, with the value depending on its configuration.
9595

96-
=== Enabling WebAssembly extension support
96+
include::modules/ossm-extensions-wasm-support.adoc[leveloffset=+2]
9797

98-
Support for WebAssembly extensions to {ProductName} is currently in Tech Preview, so it must be explicitly enabled for your `ServiceMeshControlPlane`. Set `spec.techPreview.wasmExtensions.enabled` in your SMCPv2 to `true`. Here's an example:
99-
100-
[source,yaml]
101-
----
102-
apiVersion: maistra.io/v2
103-
kind: ServiceMeshControlPlane
104-
metadata:
105-
name: openid-connect
106-
namespace: istio-system
107-
spec:
108-
techPreview:
109-
wasmExtensions:
110-
enabled: true
111-
----
112-
113-
=== Deploying extensions
114-
115-
{ProductName} extensions can be enabled using the `ServiceMeshExtension` resource. The following snippet is an example resource.
116-
117-
[source,yaml]
118-
----
119-
apiVersion: maistra.io/v1alpha1
120-
kind: ServiceMeshExtension
121-
metadata:
122-
name: header-append
123-
namespace: istio-system
124-
spec:
125-
workloadSelector:
126-
labels:
127-
app: httpbin
128-
config: test
129-
image: quay.io/maistra-dev/header-append-filter:latest
130-
phase: PostAuthZ
131-
priority: 100
132-
----
98+
include::modules/ossm-extensions-wasm-deploy.adoc[leveloffset=+2]
13399

134100
.ServiceMeshExtension Field Reference
135101
|===
@@ -142,7 +108,7 @@ spec:
142108
|The `spec.workloadSelector` field has the same semantic as the `spec.selector` field of the link:https://istio.io/v1.6/docs/reference/config/networking/gateway/#Gateway[Istio Gateway resource]. It will match a workload based on its Pod labels. If no `workloadSelector` is specified, the extension will be applied to all workloads in the namespace.
143109

144110
|spec.config
145-
|This is a pass-through string field that will be handed over to the extension, so syntax and semantics are dependant on the extension you're deploying.
111+
|This is a pass-through string field that is handed over to the extension. Syntax and semantics are dependent on the extension that you are deploying.
146112

147113
|spec.image
148114
|A container image URI pointing to the image that holds the extension.

0 commit comments

Comments
 (0)