adjust wasm plugin doc (#146)

This commit is contained in:
澄潭
2023-01-28 19:58:56 +08:00
committed by GitHub
parent 059f4c682e
commit 4cd7975295
3 changed files with 51 additions and 45 deletions

View File

@@ -33,7 +33,7 @@ docker push <your_registry_hub>/request-block:1.0.0
Read this [document](https://istio.io/latest/docs/reference/config/proxy_extensions/wasm-plugin/) to learn more about wasmplugin.
```yaml
apiVersion: extensions.istio.io/v1alpha1
apiVersion: extensions.higress.io/v1alpha1
kind: WasmPlugin
metadata:
name: request-block
@@ -42,7 +42,7 @@ spec:
selector:
matchLabels:
higress: higress-system-higress-gateway
pluginConfig:
defaultConfig:
block_urls:
- "swagger.html"
url: oci://<your_registry_hub>/request-block:1.0.0
@@ -64,7 +64,7 @@ content-length: 0
## route-level & domain-level takes effect
```yaml
apiVersion: extensions.istio.io/v1alpha1
apiVersion: extensions.higress.io/v1alpha1
kind: WasmPlugin
metadata:
name: request-block
@@ -73,29 +73,32 @@ spec:
selector:
matchLabels:
higress: higress-system-higress-gateway
pluginConfig:
defaultConfig:
# this config will take effect globally (all incoming requests not matched by rules below)
block_urls:
- "swagger.html"
_rules_:
# route-level takes effect
- _match_route_:
- default/foo
# the ingress foo in namespace default will use this config
block_bodys:
- "foo"
- _match_route_:
- default/bar
# the ingress bar in namespace default will use this config
block_bodys:
- "bar"
# domain-level takes effect
- _match_domain_:
- "*.example.com"
# if the request's domain matched, this config will be used
block_bodys:
- "foo"
- "bar"
matchRules:
# ingress-level takes effect
- ingress:
- default/foo
# the ingress foo in namespace default will use this config
config:
block_bodys:
- "foo"
- ingress:
- default/bar
# the ingress bar in namespace default will use this config
config:
block_bodys:
- "bar"
# domain-level takes effect
- domain:
- "*.example.com"
# if the request's domain matched, this config will be used
config:
block_bodys:
- "foo"
- "bar"
url: oci://<your_registry_hub>/request-block:1.0.0
```