All Products
Search
Document Center

Container Service for Kubernetes:Create a workflow cluster

Last Updated:Mar 07, 2024

Workflow clusters are deployed on top of a serverless architecture. This type of cluster runs Argo workflows on elastic container instances, optimizes cluster parameters to schedule large-scale workflows with efficiency and elasticity, and uses preemptible elastic container instances. You can create workflow clusters to improve efficiency and reduce costs. This topic describes how to create a workflow cluster.

Prerequisites

Create a workflow cluster

Use the console

  1. Log on to the ACK One console.

  2. On the Workflow Cluster page, click Create Workflow Cluster in the upper-right corner. Configure the parameters in the panel that appears and click Create.

    Parameter

    Description

    Cluster Name

    Enter a name for the cluster.

    Note

    The name must be 1 to 63 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.

    Region

    Select a region to deploy the cluster.

    VPC

    Select a VPC from the drop-down list.

    vSwitch

    Select a vSwitch from the drop-down list.

    SLB Instance for API Server

    No configuration is needed. When you create a workflow cluster, a Server Load Balancer (SLB) instance of the slb.s2.small type is created for the API server. If you delete the SLB instance, API server becomes inaccessible.

    For more information about SLB billing, see Billing overview.

    Create and Associate EIP

    Specify whether to associate an elastic IP address (EIP) with the SLB instance.

    • If you enable the feature, the system creates an EIP and associates it with the internal-facing SLB instance of the API server. This exposes the API server to the Internet. You cannot disassociate the EIP because the EIP may be used by clusters to connect to the Fleet instance through Internet connections.

    • If you disable this feature, the API server cannot be accessed over the Internet.

    For more information about EIP billing, see Billing overview.

    Enable Collection of Operation Logs and Auditing Logs

    Specify whether to enable Simple Log Service.

    After you enable this feature, the system automatically creates a Service named k8s-log-{ClusterID} and collects the logs of control plane components, including kube-apiserver and kube-controller-manager, to the Service. This allows you to audit the logs of workflow clusters.

    For more information about the billing of Simple Log Service, see Billing overview.

Use the Alibaba Cloud CLI

  1. Run the following command to create a workflow cluster:

    aliyun configure set --region cn-zhangjiakou
    aliyun adcp CreateHubCluster --Profile XFlow --RegionId cn-zhangjiakou --VpcId vpc-xxx --VSwitches "[\"vsw-xxx\",\"vsw-xxx\"]" --Name workflow1 --ApiServerPublicEip true --IsEnterpriseSecurityGroup true

    Parameter

    Description

    Profile

    Set the value to XFlow. This parameter is required.

    RegionId

    The region where the workflow cluster is deployed. This parameter is required. In this example, the value is set to cn-zhangjiakou.

    VpcId

    The ID of the VPC where the workflow cluster is deployed. This parameter is required.

    VSwitches

    The IDs of the vSwitches that are used by the elastic container instance on which the workflow runs. The value is an array. This parameter is required. Specify vSwitches that reside in different zones.

    Name

    The name of the workflow cluster. This parameter is optional.

    IsEnterpriseSecurityGroup

    Specify whether to use an advanced security group. Set the value to true. This parameter is required.

    ApiServerPublicEip

    Specify whether to use an EIP to expose the endpoint of the API server of the workflow engine instance. This parameter is optional.

    The following output is returned. Record the value of the ClusterId parameter in the output.

    {
        "ClusterId": "xxx",
        "RequestId": "xxx",
        "TaskId": "xxx"
    }
  2. Run the following command to query the status of the workflow cluster.

    Replace XXX with the cluster ID that you recorded in the previous step.

    aliyun adcp DescribeHubClusterDetails --ClusterId XXX | jq .Cluster.ClusterInfo

    Proceed to the next step after the workflow cluster enters the running state.

  3. Run the following commands to install jq:

    • macOS:

      brew install jq
    • CentOS:

      yum install jq 
    • Ubuntu:

      apt-get install jq
  4. Run the following command to automatically parse the text and generate a kubeconfig file:

    aliyun adcp DescribeHubClusterKubeconfig --ClusterId <cluster id> | jq -r .Kubeconfig | tee ack-argo-workflow-kubeconfig
    # Specify the kubeconfig file in environment variables and run kubectl and the Argo CLI. 
    export KUBECONFIG=ack-argo-workflow-kubeconfig

Delete a workflow cluster

Important

Before you delete a workflow cluster, you must delete all workflows in the workflow cluster. You must also delete the pods and the elastic container instances in the workflow cluster.

Use the console

  1. Log on to the ACK One console.

  2. Select the workflow cluster that you want to delete from the drop-down list in the upper-left corner of the page.

  3. On the Workflow Cluster page, click Delete Workflow Cluster in the upper-right corner. In the message that appears, click OK.

Use the Alibaba Cloud CLI

  1. Run the following command to disable Argo Server and delete the relevant SLB instance and elastic container instances:

    aliyun adcp UpdateHubClusterFeature --ArgoServerEnabled false --ClusterId <cluster id>
  2. Run the following command to delete the workflow cluster:

     aliyun adcp DeleteHubCluster --ClusterId <cluster id>

References