diff --git a/modules/ossm-extensions-wasm-deploy.adoc b/modules/ossm-extensions-wasm-deploy.adoc new file mode 100644 index 000000000000..dde89a924a92 --- /dev/null +++ b/modules/ossm-extensions-wasm-deploy.adoc @@ -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 +---- diff --git a/modules/ossm-extensions-wasm-support.adoc b/modules/ossm-extensions-wasm-support.adoc new file mode 100644 index 000000000000..dd5ff6719364 --- /dev/null +++ b/modules/ossm-extensions-wasm-support.adoc @@ -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. diff --git a/service_mesh/v2x/ossm-extensions.adoc b/service_mesh/v2x/ossm-extensions.adoc index de93a21a8f91..940ed2bcff9d 100644 --- a/service_mesh/v2x/ossm-extensions.adoc +++ b/service_mesh/v2x/ossm-extensions.adoc @@ -63,7 +63,7 @@ priority: 100 module: extension.wasm ---- -.manifest.yml Field Reference +.Field Reference for manifest.yml |=== | Field | Description @@ -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 |=== @@ -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.