すべてのプロダクト
Search
ドキュメントセンター

Container Service for Kubernetes:アーティファクトの設定

最終更新日:Feb 25, 2026

ワークフロー クラスターのアーティファクトを設定して、ワークフロー ステップ間でパラメーターを渡すことができます。あるステップの出力は、別のステップの入力になります。このプロセスにより、複雑なワークフローを編成できます。このトピックでは、Alibaba Cloud Object Storage Service (OSS) を使用してこれらのアーティファクトを保存する方法について説明します。

前提条件

Alibaba Cloud OSS が有効化されています。詳細については、「OSS の有効化」をご参照ください。

操作手順

  1. Alibaba Cloud OSS を設定します。詳細については、「Alibaba Cloud OSS の設定」をご参照ください。

  2. 以下の内容で artifact-passing.yaml ファイルを作成します。

    apiVersion: argoproj.io/v1alpha1
    kind: Workflow
    metadata:
      generateName: artifact-passing-
    spec:
      entrypoint: artifact-example
      templates:
      - name: artifact-example
        steps:
        - - name: generate-artifact
            template: whalesay
        - - name: consume-artifact
            template: print-message
            arguments:
              artifacts:
              # message を hello-art アーティファクトにバインドします。
              # このアーティファクトは generate-artifact ステップで生成されます。
              - name: message
                from: "{{steps.generate-artifact.outputs.artifacts.hello-art}}"
    
      - name: whalesay
        container:
          image: docker/whalesay:latest
          command: [sh, -c]
          args: ["cowsay hello world | tee /tmp/hello_world.txt"]
        outputs:
          artifacts:
          # /tmp/hello_world.txt から hello-art アーティファクトを生成します。
          # アーティファクトにはファイルだけでなくディレクトリも指定可能です。
          - name: hello-art
            path: /tmp/hello_world.txt
    
      - name: print-message
        inputs:
          artifacts:
          # message 入力アーティファクトを展開し、
          # /tmp/message に配置します。
          - name: message
            path: /tmp/message
        container:
          image: alpine:latest
          command: [sh, -c]
          args: ["cat /tmp/message"]
  3. 以下のコマンドを実行して、ワークフローを送信します。

    argo submit artifact-passing.yaml
  4. 以下のコマンドを実行して、ワークフローのステータスを確認します。

    argo list