All Products
Search
Document Center

Container Service for Kubernetes:Configure artifacts

Last Updated:Dec 19, 2024

When you orchestrate complex workflows, the output of one step may be used as the input for a subsequent step. By configuring artifacts, you can pass the necessary parameters or data between workflow steps. This topic describes how to add artifact configuration to the ConfigMap of the Argo Workflows controller so that you can use Object Storage Service (OSS) to store artifact files. This setup enables the transmission of parameters between workflow steps.

Prerequisites

  • OSS is activated and an OSS bucket is created. For more information, see Activate OSS and Create a bucket.

  • If the OSS bucket and the cluster reside in the same virtual private cloud (VPC), you can access OSS resources over the internal endpoint at no additional traffic cost. For more information about OSS billing, see Billable items.

Procedure

  1. Create a Secret named my-oss-secret in the argo namespace to store the AccessKey used to access OSS.

    apiVersion: v1
    stringData:
      accessKey: xxxxxxxxxx # Replace with the AccessKey ID used to access OSS.
      secretKey: xxxxxxxxxx # Replace with the AccessKey secret used to access OSS.
    kind: Secret
    metadata:
      name: my-oss-secret
      namespace: argo
    type: Opaque
  2. Run the following command to edit the workflow-controller-configmap file:

    kubectl edit configmap workflow-controller-configmap -n argo

    Insert the artifact configuration into the data field.

    data:
      artifactRepository: |
       archiveLogs: true
       oss:
         endpoint: http://oss-cn-zhangjiakou-internal.aliyuncs.com # Replace with the OSS endpoint.
         bucket: my-bucket # Replace with the actual OSS bucket name.
         accessKeySecret:
           name: my-oss-secret
           key: accessKey
         secretKeySecret:
           name: my-oss-secret
           key: secretKey        

    After configuration, the Argo Workflows controller will monitor the ConfigMap, and perform operations such as uploading, downloading, and deleting files based on your workflow.