|
| 1 | +//// |
| 2 | +This module included in the following assemblies: |
| 3 | +*service_mesh_/v2x/ossm-extensions.adoc |
| 4 | +//// |
| 5 | +:_content-type: CONCEPT |
| 6 | +[id="ossm-extensions-migration-overview_{context}"] |
| 7 | += Migrating from `ServiceMeshExtension` to `WasmPlugin` resources |
| 8 | +
|
| 9 | +The `ServiceMeshExtension` API is deprecated as of {SMProductName} version 2.2 and will be removed in a future release. If you are using the `ServiceMeshExtention` API, you must migrate to the `WasmPlugin` API to continue using your WebAssembly extensions. |
| 10 | +
|
| 11 | +The APIs are very similar. The migration consists of two steps: |
| 12 | +
|
| 13 | +. Renaming your plug-in file and updating the module packaging. |
| 14 | +
|
| 15 | +. Creating a `WasmPlugin` resource that references the updated container image. |
| 16 | +
|
| 17 | +[id="ossm-extensions-migration-api-changes_{context}"] |
| 18 | +== API changes |
| 19 | +
|
| 20 | +The new `WasmPlugin` API is similar to the `ServiceMeshExtension`, but with a few differences, especially in the field names: |
| 21 | +
|
| 22 | +
|
| 23 | +.Field changes between `ServiceMeshExtensions` and `WasmPlugin` |
| 24 | +[options="header"] |
| 25 | +[cols="a, a"] |
| 26 | +|=== |
| 27 | +|ServiceMeshExtension |WasmPlugin |
| 28 | +|`spec.config` |
| 29 | +|`spec.pluginConfig` |
| 30 | +
|
| 31 | +|`spec.workloadSelector` |
| 32 | +|`spec.selector` |
| 33 | +
|
| 34 | +|`spec.image` |
| 35 | +|`spec.url` |
| 36 | +
|
| 37 | +//Question about the case here, is WasmPlugin app caps? |
| 38 | +|`spec.phase` valid values: PreAuthN, PostAuthN, PreAuthZ, PostAuthZ, PreStats, PostStats |
| 39 | +|`spec.phase` valid values: <empty>, AUTHN, AUTHZ, STATS |
| 40 | +|=== |
| 41 | +
|
| 42 | +The following is an example of how a `ServiceMeshExtension` resource could be converted into a `WasmPlugin` resource. |
| 43 | +
|
| 44 | +.ServiceMeshExtension resource |
| 45 | +[source,yaml] |
| 46 | +---- |
| 47 | +apiVersion: maistra.io/v1 |
| 48 | +kind: ServiceMeshExtension |
| 49 | +metadata: |
| 50 | + name: header-append |
| 51 | + namespace: istio-system |
| 52 | +spec: |
| 53 | + workloadSelector: |
| 54 | + labels: |
| 55 | + app: httpbin |
| 56 | + config: |
| 57 | + first-header: some-value |
| 58 | + another-header: another-value |
| 59 | + image: quay.io/maistra-dev/header-append-filter:2.2 |
| 60 | + phase: PostAuthZ |
| 61 | + priority: 100 |
| 62 | +---- |
| 63 | +
|
| 64 | +.New WasmPlugin resource equivalent to the ServiceMeshExtension above |
| 65 | +[source,yaml] |
| 66 | +---- |
| 67 | +apiVersion: extensions.istio.io/v1alpha1 |
| 68 | +kind: WasmPlugin |
| 69 | +metadata: |
| 70 | + name: header-append |
| 71 | + namespace: istio-system |
| 72 | +spec: |
| 73 | + selector: |
| 74 | + matchLabels: |
| 75 | + app: httpbin |
| 76 | + url: oci://quay.io/maistra-dev/header-append-filter:2.2 |
| 77 | + phase: STATS |
| 78 | + pluginConfig: |
| 79 | + first-header: some-value |
| 80 | + another-header: another-value |
| 81 | +---- |
| 82 | +
|
| 83 | +[id="ossm-extensions-migration-format-changes_{context}"] |
| 84 | +== Container image format changes |
| 85 | +
|
| 86 | +The new `WasmPlugin` container image format is similar to the `ServiceMeshExtensions`, with the following differences: |
| 87 | +
|
| 88 | +* The `ServiceMeshExtension` container format required a metadata file named `manifest.yaml` in the root directory of the container filesystem. The `WasmPlugin` container format does not require a `manifest.yaml` file. |
| 89 | +
|
| 90 | +* The `.wasm` file (the actual plug-in) that previously could have any filename now must be named `plugin.wasm` and must be located in the root directory of the container filesystem. |
0 commit comments