본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

한 워크플로우가 다른 워크플로우 제출하기 (One Workflow Submitting Another)

원문 보기 위키 갱신

워크플로우 안에서 curl로 다른 워크플로우를 생성할 수 있어요. 액세스 토큰을 활용해 워크플로우 템플릿에서 워크플로우를 제출하는 방법을 살펴봐요.

출처: Argo Workflows 문서

본문

v2.8 and after

한 워크플로우가 다른 워크플로우를 만들게 하고 싶다면 curl을 사용하면 돼요. 액세스 토큰(access token)이 필요해요. 일반적으로 가장 좋은 방법은 워크플로우 템플릿에서 제출하는 거예요:

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: demo-
spec:
  entrypoint: main
  templates:
    - name: main
      steps:
        - - name: a
            template: create-wf
    - name: create-wf
      script:
        image: curlimages/curl:latest
        command:
          - sh
        source: >
          curl https://argo-server:2746/api/v1/workflows/argo/submit \
            -fs \
            -H "Authorization: Bearer ***" \
            -d '{"resourceKind": "WorkflowTemplate", "resourceName": "wait", "submitOptions": {"labels": "workflows.argoproj.io/workflow-template=wait"}}'

더 알아보기 (Learn more)