All Products
Search
Document Center

Alibaba Cloud Service Mesh:Customize Waypoint resource usage and HPA

Last Updated:Dec 03, 2025

Service Mesh (ASM) uses the Gateway API to deploy the Waypoint component in Ambient mode. This topic describes how to customize Waypoint configurations.

Scope

Version 1.2.1 or later of the Gateway API component is installed in your cluster.

Create a ConfigMap

ASM lets you specify the Deployment, Horizontal Pod Autoscaler (HPA), and ProxyConfig for a Waypoint using a custom ConfigMap. Ensure that the ConfigMap and Gateway resources are in the same namespace.

  1. Create a file named gw-options.yaml with the following content.

    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: gw-options
    data:
      horizontalPodAutoscaler: |
        spec:
          minReplicas: 2
          maxReplicas: 2
      deployment: |
        spec:
          # Do not configure replicas when HPA is enabled.
          # replicas: 4
          template:
            spec:
              containers:
              - name: istio-proxy
                resources:
                  requests:
                    cpu: 1000m
              # The maximum wait time before a pod goes offline.
              terminationGracePeriodSeconds: 120
      proxyConfig: |
        # The proxy drain duration.
        drainDuration: 30s
        # The maximum duration for the proxy to stop draining. Ensure that terminationGracePeriodSeconds > terminationDrainDuration > drainDuration.
        terminationDrainDuration: 60s
    • data.horizontalPodAutoscaler: Defines the HPA configuration. In this example, the minimum and maximum number of pod replicas are both set to 2.

    • data.deployment: Configures the pod-level template. In this example, the container name is set to istio-proxy and the CPU request is set to 1000m.

    • data.proxyConfig: Defines the runtime configuration of the Istio proxy (istio-proxy).

  2. Create the ConfigMap.

    kubectl apply -f gw-options.yaml

Update the Waypoint

  1. Modify the Gateway resource to reference the ConfigMap. Save the following content as a file named gateway.yaml.

    apiVersion: gateway.networking.k8s.io/v1
    kind: Gateway
    metadata:
      name: waypoint
      namespace: default
    spec:
      infrastructure:
        parametersRef:
          group: ""
          kind: ConfigMap
          name: gw-options
      gatewayClassName: istio-waypoint
      listeners:
      - allowedRoutes:
          namespaces:
            from: Same
        name: mesh
        port: 15008
        protocol: HBONE
  2. Update the Waypoint.

    kubectl apply -f gateway.yaml

    After the update, ASM uses the configuration in the ConfigMap to perform a Strategic Merge Patch on the default resource configuration. ASM then creates or updates the Waypoint resource based on the merged configuration.