HTTP 템플릿 (HTTP Template)
v3.2 이상
HTTP Template은 HTTP 요청을 실행할 수 있는 템플릿 타입입니다. 응답 본문은 자동으로 result 출력 파라미터에 저장됩니다.
본문
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: http-template-
spec:
entrypoint: main
templates:
- name: main
steps:
- - name: get-google-homepage
template: http
arguments:
parameters: [{name: url, value: "https://www.google.com"}]
- name: http
inputs:
parameters:
- name: url
http:
timeoutSeconds: 20 # Default 30
url: "{{inputs.parameters.url}}"
method: "GET" # Default GET
headers:
- name: "x-header-name"
value: "test-value"
# Template will succeed if evaluated to true, otherwise will fail
# Available variables:
# request.body: string, the request body
# request.headers: map[string][]string, the request headers
# request.url: string, the request url
# request.method: string, the request method
# response.statusCode: int, the response status code
# response.body: string, the response body
# response.headers: map[string][]string, the response headers
successCondition: "response.body contains \"google\"" # available since v3.3
body: "test body" # Change request body
Argo Agent RBAC
HTTP 템플릿과 플러그인 템플릿은 Argo Agent를 사용하며, 이 Agent는 컨트롤러와 독립적으로 요청을 실행합니다.
Agent와 Workflow Controller는 WorkflowTaskSet CRD를 통해 통신하며, 이 CRD는 Agent를 사용해야 하는 실행 중인 각 Workflow마다 생성됩니다.
Argo Agent를 사용하려면 적절한 워크플로 RBAC를 추가해 Agent 역할(role)을 Argo Workflows에 부여했는지 확인해야 합니다. Agent 역할의 예제는 quick-start 매니페스트에서 찾을 수 있습니다.
더 알아보기 (Learn more)
successCondition식에서는request.*와response.*변수를 사용해 요청/응답을 검증할 수 있습니다.- HTTP 템플릿은 컨테이너를 띄우지 않고 요청만 실행하므로 가볍고 빠릅니다.
- Agent가 실제 요청을 수행하므로 RBAC 설정이 반드시 선행되어야 합니다.