All Products
Search
Document Center

Container Service for Kubernetes:Modify the configuration of a workflow cluster

Last Updated:Feb 01, 2024

This topic describes how to modify the configuration of a workflow cluster.

Prerequisites

Specify vSwitches for the workflow cluster

You can specify multiple vSwitches in different zones for a workflow cluster. This way, elastic container instances can be created across multiple zones. This allows the system to balance the loads of the workflow cluster by distributing requests to multiple zones. If no elastic container instances are available in a zone, the system attempts to create elastic container instances in another zone.

Important

Take note of the following limits when you specify multiple vSwitches in different zones:

  • The vSwitches must be created in the same virtual private cloud (VPC).

  • You can specify up to 10 vSwitches.

  1. Run the following command to query the vSwitches that are currently used by the workflow cluster:

     aliyun adcp  DescribeHubClusterDetails --ClusterId <cluster id> | jq .Cluster.WorkflowConfig.WorkflowUnits
  2. Run the following command to specify vSwitches for the workflow cluster.

    You must specify the original vSwitches that are used by the workflow cluster in the following command:

    aliyun adcp UpdateHubClusterFeature --VSwitches "[\"vsw-xxx\",\"vsw-xxx\",\"vsw-xxx\"]" --ClusterId <cluster id>

Set the scheduling mode of the workflow cluster

Workflow clusters support the following scheduling modes:

  • Inventory-prioritized scheduling mode:

    The default scheduling mode of a workflow cluster. In this mode, the workflow cluster creates pay-as-you-go elastic container instances to run workflows. If you use this mode, you do not need to specify an upper price limit.

  • Cost-prioritized scheduling mode:

    • In this mode, the workflow cluster creates preemptible elastic container instances to run workflows in a cost-effective manner. You can specify multiple instance types and zones for preemptible elastic container instances to improve the success rate of elastic container instance creation.

    • In this mode, preemptible elastic container instances may be out of stock or reclaimed earlier than expected. In this case, workflows may fail to run.

    • The upper price limit specifies the highest hourly price for each vCore or each 4 GiB of memory. Unit: USD/hour. If you do not specify an upper price limit, the system automatically submits bids based on the up-to-date market price. If you set the upper price limit to USD 0.1/hour, the system creates elastic container instances based on the following rules:

      • If 2 vCores and 4 GiB of memory are required, the system creates an elastic container instance with 2 vCores, 4 GiB of memory, and an hourly price lower than USD 0.3/hour (USD 0.1/hour × 2 + USD 0.1/hour × 4 GiB/4 GiB).

      • If 4 vCores and 32 GiB of memory are required, the system creates an elastic container instance with 4 vCores, 32 GiB of memory, and an hourly price lower than USD 1.2/hour (USD 0.1/hour × 4 + USD 0.1/hour × 32 GiB/4 GiB).

    • If preemptible elastic container instances are out of stock and no upper price limit is specified, the system creates pay-as-you-go elastic container instances to run workflows.

Run the following commands to set the scheduling mode of a workflow cluster.

  • Run the following command to set the scheduling mode of the workflow cluster to inventory-prioritized:

    aliyun adcp UpdateHubClusterFeature --WorkflowScheduleMode "stock-optimized" --ClusterId <cluster id>
  • Run the following command to set the scheduling mode of the workflow cluster to cost-prioritized and specify an upper price limit:

    aliyun adcp UpdateHubClusterFeature --WorkflowScheduleMode "cost-optimized" --PriceLimit "0.10" --ClusterId <cluster id>
  • Run the following command to set the scheduling mode of the workflow cluster to cost-prioritized without specifying an upper price limit:

    aliyun adcp UpdateHubClusterFeature --WorkflowScheduleMode "cost-optimized" --PriceLimit "" --ClusterId <cluster id>

    The following table describes the parameters in the commands.

    Parameter

    Description

    WorkflowScheduleMode

    The scheduling mode of the workflow cluster. This parameter is required. Valid values:

    • stock-optimized: inventory-prioritized

    • cost-optimized: cost-prioritized

    PriceLimit

    The hourly upper price limit of each vCore. Unit: USD/hour. This parameter is optional. This parameter takes effect only if you set WorkflowScheduleMode to cost-optimized. Example: "0.10".

Configure the workflow-controller-configmap ConfigMap

When you use open source Argo Workflows, you can customize workflows by configuring the workflow-controller-configmap ConfigMap. For example, you can configure the workflow-controller-configmap ConfigMap to remove large jobs from etcd by using PostgreSQL or MySQL, archive workflows to PostgreSQL or MySQL, or modify the configuration of pod garbage collection.

Important
  • The workflow-controller-configmap ConfigMap belongs to the namespace that is named after the cluster ID.

  • Do not delete the following parameters in the podMetadata section.

      podMetadata:
        labels:
          workflow.xflow.aliyun: xflow
        annotations:
          k8s.aliyun.com/eci-auto-imc: "true"
          k8s.aliyun.com/eci-fail-strategy: "fail-fast"

Configure the quotas of elastic container instances

By default, a maximum number of 1,000 vCores can be used by elastic container instances that belong to an Alibaba Cloud account. You can view the quota details on the Privileges and Quotas page in the Elastic Container Instance console.

To increase the quota, submit an application in the Quota Center console. For more information, see Limits on elastic container instances.