Service Mesh (ASM) of version 1.21.6.54 or later allows you to configure ASMHeaderPropagation CRD. This way, you can define a request header pass-through rule. If the pods for Services can pass through baggage headers, you can use the ASMHeaderPropagation CRD to specify the custom request headers that you want to pass through on the call chain in the context of baggage headers. This topic provides sample configuration and explains the fields within ASMHeaderPropagation.
Sample configuration
ASMHeaderPropagation enables the passing of specific request headers along call trace, facilitating traffic management. In this example, the request header is passed through the call trace for all workloads into which a sidecar proxy is injected in the default namespace of the cluster.
apiVersion: istio.alibabacloud.com/v1beta1
kind: ASMHeaderPropagation
metadata:
name: version-propagation
namespace: default
spec:
headers:
- version
To pass through the version request header, you must configure auto-instrumentation or modify the code to enable Baggage pass-through capability for the service. For detailed configuration steps for Baggage and examples of using ASMHeaderPropagation CRD, see Configure ASMHeaderPropagation CRDs to implement traffic lanes in permissive mode and Canary release of multiple applications by user segment based on the multi-tag routing rules achieved by Hash tagging plug-in.
Field description
spec
Field | Type | Required | Description |
workloadSelector | No | Specifies a specific set of pods where the request header pass-through is effective through one or more tags. The tags can be searched only in the configured namespace where the resource is located. If not specified, the request header pass-through rules of ASMHeaderPropagation will be effective on all workloads in the specified namespace. | |
headers | []string | Required if headerPrefix is not configured | The list of the request headers that need to be passed through on the call trace. The request header will be passed through if it is included in the list. |
headerPrefix | []string | Required if headers is not configured | The prefixes of the request headers that need to be passed through on the call trace. The request header will be passed through if it contains any of the prefixs. |
WorkloadSelector
Field | Type | Required | Description |
labels | map<string, string> | Yes | Specifies the pods where the rule is effective. At least one set of tags is required. |