Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions modules/ossm-extensions-wasm-deploy.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[id="ossm-extensions-deploy_{context}"]
= Deploying extensions

{ProductName} extensions can be enabled using the `ServiceMeshExtension` resource.

.Procedure

. Create the following example resource:
+
.Example ServiceMeshExtension resource extension.yaml
[source,yaml]
----
apiVersion: maistra.io/v1alpha1
kind: ServiceMeshExtension
metadata:
name: header-append
namespace: istio-system
spec:
workloadSelector:
labels:
app: httpbin
config: test
image: quay.io/maistra-dev/header-append-filter:2.0
phase: PostAuthZ
priority: 100
----

. Apply the `extension.yaml` file with the following command:
+
[source,terminal]
----
$ oc apply -f extension.yaml
----
33 changes: 33 additions & 0 deletions modules/ossm-extensions-wasm-support.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[id="ossm-extensions-support_{context}"]
= Enabling WebAssembly extension support

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`.

.Procedure

. In the {product-title} web console, click *Operators* -> *Installed Operators*.

. From the *Project* menu, select the project where you installed the control plane, for example `istio-system`.

. Click the {ProductName} Operator. In the *Istio Service Mesh Control Plane* column, click the name of your `ServiceMeshControlPlane` resource, for example `basic`.

. Click the *YAML* tab.

. Set `spec.techPreview.wasmExtensions.enabled` in your `ServiceMeshControlPlane` resource to `true`. For example:
+
[source,yaml]
----
apiVersion: maistra.io/v2
kind: ServiceMeshControlPlane
metadata:
name: openid-connect
namespace: istio-system
spec:
techPreview:
wasmExtensions:
enabled: true
----

. Click *Save*.

. Click *Reload* to verify the `ServiceMeshControlPlane` resource was configured correctly.
44 changes: 5 additions & 39 deletions service_mesh/v2x/ossm-extensions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ priority: 100
module: extension.wasm
----

.manifest.yml Field Reference
.Field Reference for manifest.yml
|===
| Field | Description

Expand Down Expand Up @@ -91,45 +91,11 @@ module: extension.wasm

=== Example Rust extension

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.
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.

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

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:

[source,yaml]
----
apiVersion: maistra.io/v2
kind: ServiceMeshControlPlane
metadata:
name: openid-connect
namespace: istio-system
spec:
techPreview:
wasmExtensions:
enabled: true
----

=== Deploying extensions

{ProductName} extensions can be enabled using the `ServiceMeshExtension` resource. The following snippet is an example resource.

[source,yaml]
----
apiVersion: maistra.io/v1alpha1
kind: ServiceMeshExtension
metadata:
name: header-append
namespace: istio-system
spec:
workloadSelector:
labels:
app: httpbin
config: test
image: quay.io/maistra-dev/header-append-filter:latest
phase: PostAuthZ
priority: 100
----
include::modules/ossm-extensions-wasm-deploy.adoc[leveloffset=+2]

.ServiceMeshExtension Field Reference
|===
Expand All @@ -142,7 +108,7 @@ spec:
|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.

|spec.config
|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.
|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.

|spec.image
|A container image URI pointing to the image that holds the extension.
Expand Down