Service Mesh (ASM) provides two CustomResourceDefinitions (CRDs) -- EnvoyFilterTemplate and EnvoyFilterTemplateBinding -- for creating reusable, version-aware Envoy filter configurations. Define a filter template once, then bind it to workloads, namespaces, and Istio versions without duplicating YAML.
Why use these CRDs instead of raw EnvoyFilter resources?
Version safety. Manually maintained EnvoyFilter resources can become incompatible after an ASM instance upgrade because the Envoy proxy version changes. EnvoyFilterTemplate lets you define version-specific filter configurations so the correct filter is automatically applied after an upgrade.
Reusability. A single template produces multiple EnvoyFilter resources across workloads and namespaces through separate bindings.
Less duplication. Metadata and workload selectors are auto-populated from the binding. You do not need to duplicate them in the template.
The istioVersion ranges defined in a single EnvoyFilterTemplate must not overlap.
How it works
Create an EnvoyFilterTemplate that contains one or more filter configurations, each targeting a specific Istio version range.
Create an EnvoyFilterTemplateBinding that references the template and specifies which workloads and Envoy proxy versions the filter applies to.
ASM automatically generates the corresponding EnvoyFilter resources with the correct metadata, labels, and workload selectors.
Configuration example
The following example defines an EnvoyFilterTemplate that sets HTTP/2 connection and stream window sizes on port 80 for ASM instances running Istio 1.19 and later. A corresponding EnvoyFilterTemplateBinding then generates an Envoy filter targeting proxies on version 1.20, applied globally in the istio-system namespace.
EnvoyFilterTemplate
EnvoyFilterTemplateBinding
apiVersion: istio.alibabacloud.com/v1
kind: EnvoyFilterTemplateBinding
metadata:
name: seth2windows-binding-1.20
namespace: istio-system
spec:
templateRef:
istioVersion: "1.20"
name: seth2windows
workloads:
- kind: Namespace
namespace: istio-systemEnvoyFilterTemplate fields
EnvoyFilterTemplate defines Envoy filter configurations for different Istio versions. After an ASM instance upgrade, the matching filter configuration is automatically applied to the upgraded Envoy proxies, which reduces compatibility risks compared to manually maintained EnvoyFilter resources.
EnvoyFilterTemplateSpec
Field | Type | Required | Description |
| Yes | A list of Envoy filter template entries. Each entry targets a specific Istio version or version range. Version ranges across entries must not overlap. |
TemplateValue
Each TemplateValue pairs an Envoy filter configuration (in YAML) with the Istio version range it applies to.
Field | Type | Required | Description |
| string | Yes | The Istio version or version range this filter targets. Specify an Istio minor version such as |
| string | Yes | The Envoy filter configuration in YAML format. Must conform to the EnvoyFilter CRD spec. Omit the |
Version range syntax
Example | Meaning |
| Matches ASM instances running Istio 1.19 only. |
| Matches Istio 1.18, 1.19, and 1.20. |
| Matches Istio 1.19 and all later versions. |
| Matches Istio 1.19 and all earlier versions. |
EnvoyFilterTemplateBinding fields
An EnvoyFilterTemplateBinding associates with one EnvoyFilterTemplate and specifies the workloads and Envoy proxy versions for which ASM generates EnvoyFilter resources.
EnvoyFilterTemplateBindingSpec
Field | Type | Required | Description |
| Yes | References the EnvoyFilterTemplate and specifies the Envoy proxy version to target. ASM uses this to select the correct template entry and to set the | |
| No | The workloads to generate Envoy filters for. |
EnvoyFilterTemplateRef
Field | Type | Required | Description |
| string | Yes | The name of the EnvoyFilterTemplate to reference. |
| string | Yes | The Envoy proxy version to target. Uses the same Version range syntax as |
WorkloadRef
Defines the workloads the generated Envoy filter applies to.
Field | Type | Required | Default behavior | Description |
| string | Yes | -- | The namespace where the Envoy filter is created. To apply the filter globally across the ASM instance, set this to |
| string | No | Filter applies namespace-wide. | The workload name. This value becomes part of the generated EnvoyFilter name. Set this to the Service or Deployment name when you target a specific workload. |
| string | No | -- | The workload type (for example, |
| map<string, string> | No | Filter applies to all pods in the namespace. | A set of labels to select specific pods. ASM converts this into the |
References
Create an Envoy filter by using an Envoy filter template: Step-by-step operations for creating and managing Envoy filter templates.
Enable plug-ins to extend ASM capabilities: Select and customize plug-ins from the ASM plug-in marketplace.