ASMMeshConfig is a Custom Resource (CR) provided by Alibaba Cloud Service Mesh (ASM) to define mesh-wide settings. Similar in function to Istio's MeshConfig, it lets you centrally manage parameters like connection timeouts, protocol detection, path normalization, retry policies, sidecar injector behavior, and access log configuration.
Configuration example
The following example shows a configuration for connection settings, path normalization, the default HTTP retry policy, the sidecar injector, access logging, and global rate limiting.
apiVersion: istio.alibabacloud.com/v1beta1
kind: ASMMeshConfig
metadata:
name: default
spec:
connectTimeout: 30s
tcpKeepalive:
probes: 5
time: 7200s
interval: 72s
pathNormalization:
normalization: MERGE_SLASHES
defaultHttpRetryPolicy:
attempts: 3
perTryTimeout: 1s
retryOn: gateway-error,connect-failure,refused-stream
enablePrometheusMerge: true
sidecarInjectorWebhookConfiguration:
rewriteAppHTTPProbe: true
replicaCount: 2
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: '2'
memory: 2Gi
rateLimitService:
enabled: true
redis:
authSecret: redis-secret
url: redis.istio-system.svc:6379
replicas: 1
accessLogConfiguration:
logEncoding: JSON
logProject: test-project
sidecarEnabled: trueTo use all fields of the ASMMeshConfig CRD, your Service Mesh instance version must be 1.24 or later. Specifically, the rateLimitService configuration requires instance version 1.25.6.84. In addition, the ASMMeshConfig CR is not namespaced and its name must be default. Any ASMMeshConfig CR with a different name will not take effect.
Fields
spec
Field path | Type | Description | Value |
| TcpKeepalive | Configures TCP keepalive settings for outbound connections. |
|
| Duration | Specifies the maximum wait time for the Envoy proxy to establish a TCP connection. A timeout triggers an |
|
| Duration | Timeout for automatic protocol detection, which identifies HTTP/HTTPS traffic. After the timeout, traffic is treated as raw TCP. Important Available only in ASM versions 1.19 and earlier. | |
| PathNormalization | Configures path normalization for HTTP requests. | |
| DefaultHttpRetryPolicy | Defines the default HTTP retry policy for sidecars. | |
| Bool | Automatically merges the Pod's original |
|
| SidecarInjectorWebhookConfiguration | Configures the sidecar injector. | |
| AccessLogConfiguration | Configures the format and collection of access logs. | |
| RatelimitService | Configures the global rate limiting service. Important Available only in ASM versions 1.25 and later. |
TCP keepalive
Field path | Type | Description | Value | Scope |
| Uint32 | The maximum number of TCP keepalive probes to send. A value of |
| Outbound TCP Persistent Connections. |
| Duration | Idle time before the first keepalive probe is sent. |
| |
| Duration | The keep-alive probe sending interval must be less than the |
|
Path normalization
Field path | Type | Description | Value | Scope |
| Enum | Specifies the URI path processing policy:
|
| Mesh-wide HTTP routing. |
Default HTTP retry policy
Field path | Type | Description | Value | Scope |
| Int32 | Maximum number of attempts, including the initial request. This setting applies only if the |
| HTTP routing policy. |
| Duration | Timeout for each individual attempt. Must be shorter than the overall timeout defined in the |
| |
| String | The conditions that trigger a retry support standard error types such as |
|
Sidecar injector
Field path | Type | Description | Value | Scope |
| Bool | If true, redirects Pod HTTP readiness probes to the sidecar proxy port, ensuring that probes pass through the mesh. |
| Sidecar injection behavior. |
| Int | Number of sidecar injector controller replicas. Increase this value for High Availability in production clusters. |
| Sidecar injector component. |
| Object | Resource requests and limits for the sidecar injector container:
| | Sidecar injector component. |
Access log
Field path | Type | Description | Value |
| String | The output format for logs. Valid values: |
|
| String | The name of the Alibaba Cloud Log Service (SLS) project that receives the logs. Important Available only in ASM versions 1.25 and later. |
|
| Boolean | Enables access log collection from gateways to Alibaba Cloud Log Service (SLS). |
|
| Boolean | Enables access log collection from sidecars to Alibaba Cloud Log Service (SLS). |
|
| Boolean | Enables access log collection from Ztunnel to Alibaba Cloud Log Service (SLS). Important Available only in ASM versions 1.25 and later. |
|
| Integer | Retention period in days for gateway access logs. Defaults to 90. |
|
| Integer | Retention period in days for sidecar access logs. Defaults to 90. |
|
| Integer | Retention period in days for Ztunnel access logs. Defaults to 90. Important Available only in ASM versions 1.25 and later. |
|
Global rate limiting
Field path | Type | Description | Value | Scope |
| Bool | If true, enables the global rate limiting service. |
| Global rate limiting capability. |
| Int | The number of replicas for the rate limiting service. |
| Availability and performance of the rate limiting service. |
| Object | Resource configuration for the rate limiting service. | | Availability and performance of the rate limiting service. |
| Object | Configuration for the Redis instance that the rate limiting service uses. Note The global rate limiting service uses Redis to store policies and decisions. | | Rate limiting state backend. |
| String | The Redis cluster type. The valid values are |
| Rate limiting state backend. |
| String | The Redis connection address. |
| Rate limiting state backend. |
| String | The Redis authentication credentials, in the format: | xxxxxx | Credentials management. |
| String | Name of the Kubernetes Secret that stores Redis authentication information. Note This Secret must be deployed in the | | Credentials management. |
| String | Prefix for all Redis cache keys. Defaults to empty. | N/A | Rate limiting state backend. |
We recommend that you use Alibaba Cloud Redis to ensure high availability. You can configure rateLimitService.redis.type based on your Redis instance type by referring to the following table.
Instance type | Architecture | Connection mode |
|
Single-node | -- | -- |
|
High-availability | Cluster disabled | -- |
|
Cluster enabled | Direct connection |
| |
Proxy mode |
|
ASM aggregates all configurations and automatically generates a rate-limiting service configuration named ratelimit-service-config in the istio-system namespace. When you enable the rate-limiting service, this configuration is automatically mounted. You do not need to manually update the rate-limiting service configuration.