1.19.6. 从 ServiceMeshExtension 迁移到 WasmPlugin 资源
ServiceMeshExtension API 从 Red Hat OpenShift Service Mesh 版本 2.2 开始已弃用,并将在以后的版本中删除。如果使用 ServiceMeshExtention API,则必须迁移到 WasmPlugin API 才能继续使用 WebAssembly 扩展。
API 非常相似。迁移由两个步骤组成:
- 重命名您的插件文件并更新模块打包。
-
创建引用更新的容器镜像的
WasmPlugin资源。
1.19.6.1. API 更改 复制链接链接已复制到粘贴板!
新的 WasmPlugin API 与 ServiceMeshExtension 类似,但有一些区别,特别是在字段名称中:
| ServiceMeshExtension | WasmPlugin |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
以下是如何将 ServiceMeshExtension 资源转换为 WasmPlugin 资源的示例。
ServiceMeshExtension 资源
apiVersion: maistra.io/v1
kind: ServiceMeshExtension
metadata:
name: header-append
namespace: istio-system
spec:
workloadSelector:
labels:
app: httpbin
config:
first-header: some-value
another-header: another-value
image: quay.io/maistra-dev/header-append-filter:2.2
phase: PostAuthZ
priority: 100
新的 WasmPlugin 资源等同于上面的 ServiceMeshExtension
apiVersion: extensions.istio.io/v1alpha1
kind: WasmPlugin
metadata:
name: header-append
namespace: istio-system
spec:
selector:
matchLabels:
app: httpbin
url: oci://quay.io/maistra-dev/header-append-filter:2.2
phase: STATS
pluginConfig:
first-header: some-value
another-header: another-value