Description of the EnvoyFilterTemplate and EnvoyFilterTemplateBinding CRDs
ASM allows you to create Envoy filters by using Envoy filter templates (EnvoyFilterTemplate) and Envoy filter template bindings (EnvoyFilterTemplateBinding). The same Envoy filter template can create multiple Envoy filters that apply to different workloads and namespaces, which improves configuration reuse and management efficiency.
Configuration example
The following configuration specifies an Envoy filter template (EnvoyFilterTemplate). This template specifies Envoy filter template content that applies to Istio versions 1.19 and later. The configuration also specifies an Envoy filter template binding (EnvoyFilterTemplateBinding). This template binding creates an Envoy filter (EnvoyFilter) that takes effect in the istio-system namespace, which means that it takes effect globally. The Envoy filter takes effect on all data plane proxies of version 1.20. The filter content comes from the Envoy filter template defined above, which applies to Istio version 1.19 and later.
The preceding configuration ultimately creates the following Envoy filter:
Description of EnvoyFilterTemplate fields
EnvoyFilterTemplate defines a series of Envoy filter (EnvoyFilter) contents. These Envoy filters apply to different Istio versions. Because Envoy filters carry version compatibility risks, creating Envoy filters on your own poses significant challenges for the upgrade and maintenance of the mesh. With EnvoyFilterTemplate, customize Envoy filter content for each Istio version. After the data plane proxies are upgraded to a new version, the Envoy filter for that version can take effect on the upgraded proxies. This reduces compatibility risks.
EnvoyFilterTemplateSpec
EnvoyFilterTemplateSpec is the core configuration of EnvoyFilterTemplate, that is, the spec section.
|
Field |
Type |
Required |
Description |
|
templates |
Yes |
Specifies a series of Envoy filter template values. Each template value has an applicable Istio version or version range. The applicable Istio version ranges of the template values must not overlap. |
TemplateValue
Each TemplateValue specifies the YAML content of an Envoy filter and the applicable Istio version or version range that corresponds to the Envoy filter.
|
Field |
Type |
Required |
Description |
|
istioVersion |
string |
Yes |
The Istio version or version range that the Envoy filter applies to. The version must be a minor version of Istio, such as 1.19 or 1.20. Use a hyphen (-) to join two versions, which indicates that the Envoy filter can take effect throughout the specified version range. When you express a version range, use Examples:
|
|
value |
string |
Yes |
The YAML content of the Envoy filter. The content must be a YAML string, and the YAML must conform to the Envoy filter field definitions. For the field definitions of Envoy filters, see Envoy Filter CRD reference. The Envoy filter content defined in TemplateValue does not need to include the metadata and workloadSelector fields. These fields are populated based on the definition of the Envoy filter template binding when the Envoy filter is actually created. |
Description of EnvoyFilterTemplateBinding fields
EnvoyFilterTemplateBinding is associated with an EnvoyFilterTemplate and specifies the workloads and the data plane proxy versions on which the Envoy filter content defined in the EnvoyFilterTemplate must take effect.
EnvoyFilterTemplateBindingSpec
EnvoyFilterTemplateBindingSpec is the core configuration of EnvoyFilterTemplateBinding, that is, the spec section.
|
Field |
Type |
Required |
Description |
|
templateRef |
Yes |
The template reference, which specifies the EnvoyFilterTemplate referenced by the EnvoyFilterTemplateBinding and the bound version information. |
|
|
workloads |
No |
Specifies the workloads for which Envoy filters need to be created. |
EnvoyFilterTemplateRef
|
Field |
Type |
Required |
Description |
|
name |
string |
Yes |
The name of the referenced EnvoyFilterTemplate. |
|
istioVersion |
string |
Yes |
Specifies the versions of data plane proxies for which the Envoy filter takes effect. The version must be a minor version of Istio, such as 1.19 or 1.20. Use a hyphen (-) to join two versions, which indicates that the Envoy filter can take effect throughout the specified version range. When you express a version range, use Examples:
|
WorkloadRef
WorkloadRef defines the effective scope of an Envoy filter, which allows you to specify the workloads on which the Envoy filter takes effect.
|
Field |
Type |
Required |
Description |
|
namespace |
string |
Yes |
The namespace name, which specifies the namespace in which the Envoy filter is created. |
|
name |
string |
No |
The workload name. This name determines the name of the Envoy filter that is ultimately created. (Recommended) Set this field to the name of the Service or Deployment. When the Envoy filter takes effect on the entire namespace, you do not need to set this field. |
|
kind |
string |
No |
Distinguishes the type of the workload that the Envoy filter is bound to. This field is used for display purposes only. |
|
selector |
map<string, string> |
No |
Specifies a series of labels used as the conditions for selecting pods. The labels are converted into the workloadSelector field of the Envoy filter. If you do not set this field, the created Envoy filter takes effect on the entire namespace. |
References
-
For the relationship between Envoy filter templates and Envoy filters, and for operation examples, see Create an Envoy filter from a template.
-
For the field descriptions of EnvoyFilter, see Envoy Filter CRD reference.
-
ASM provides a set of ready-to-use feature extensions in the plugin marketplace. Select and customize various plugins based on your business requirements. For instructions, see Enable plug-ins to extend ASM capabilities.