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
Distributed Cloud Container Platform for Kubernetes (ACK One) is activated.
Alibaba Cloud CLI 3.0.159 or later is installed and credentials are configured for Alibaba Cloud CLI. For more information, see Install the Alibaba Cloud CLI and Configure credentials.
The Resource Access Management (RAM) policy AliyunAdcpFullAccess is attached to a RAM user. For more information, see Grant permissions to RAM users.
Create a workflow cluster
Use the console
Log on to the ACK One console.
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.
NoteThe 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
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" }
Run the following command to query the status of the workflow cluster.
Replace
XXX
with thecluster 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
.Run the following commands to install jq:
macOS:
brew install jq
CentOS:
yum install jq
Ubuntu:
apt-get install jq
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
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
Log on to the ACK One console.
Select the workflow cluster that you want to delete from the drop-down list in the upper-left corner of the page.
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
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>
Run the following command to delete the workflow cluster:
aliyun adcp DeleteHubCluster --ClusterId <cluster id>
References
For more information about how to modify a workflow cluster, see Modify the configuration of a workflow cluster.
After a workflow cluster is created, you can create workflows. For more information, see Create a workflow.