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

Windows 컨테이너 지원 (Windows Container Support)

원문 보기 위키 갱신

Argo Server와 워크플로 컨트롤러는 현재 Linux에서만 실행됩니다. 하지만 워크플로 실행기(executor)는 Windows 노드에서도 실행되므로, 워크플로 안에서 Windows 컨테이너를 사용할 수 있습니다. 시작하는 방법을 단계별로 살펴봅니다.

출처: Argo Workflows 문서

본문

Argo 서버와 워크플로 컨트롤러는 현재 Linux에서만 실행됩니다. 하지만 워크플로 실행기(executor)는 Windows 노드에서도 실행되므로, 워크플로 안에서 Windows 컨테이너를 사용할 수 있습니다! 시작하는 방법을 단계별로 살펴봅니다.

요구 사항 (Requirements)

  • Windows 노드를 지원하는 Kubernetes 1.14 이상
  • Kubernetes 문서에서 설명하는 것처럼 Linux 노드와 Windows 노드가 섞인 하이브리드 클러스터
  • 여기서 설명하는 방식으로 구성되고 실행 중인 Argo

Windows 컨테이너로 워크플로 스케줄하기

하이브리드 Kubernetes 클러스터에서 워크플로를 실행할 때는 항상 nodeSelector를 포함해서 단계가 올바른 호스트 OS에서 실행되도록 해야 합니다:

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: hello-windows-
spec:
  entrypoint: hello-win
  templates:
    - name: hello-win
      nodeSelector:
        kubernetes.io/os: windows    # specify the OS your step should run on
      container:
        image: mcr.microsoft.com/windows/nanoserver:1809
        command: ["cmd", "/c"]
        args: ["echo", "Hello from Windows Container!"]

이 예제를 실행하고 로그를 확인할 수 있습니다:

$ argo submit --watch https://raw.githubusercontent.com/argoproj/argo-workflows/main/examples/hello-windows.yaml
$ argo logs hello-windows-s9kk5
hello-windows-s9kk5: "Hello from Windows Container!"

하이브리드 워크플로 스케줄하기

서로 다른 단계를 서로 다른 호스트 OS에서 실행할 수도 있습니다. 예를 들어 Windows와 Linux에서 각각 애플리케이션을 빌드해야 할 때 매우 유용합니다.

예제 워크플로는 다음과 같을 수 있습니다:

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: hello-hybrid-
spec:
  entrypoint: mytemplate
  templates:
    - name: mytemplate
      steps:
        - - name: step1
            template: hello-win
        - - name: step2
            template: hello-linux

    - name: hello-win
      nodeSelector:
        kubernetes.io/os: windows
      container:
        image: mcr.microsoft.com/windows/nanoserver:1809
        command: ["cmd", "/c"]
        args: ["echo", "Hello from Windows Container!"]
    - name: hello-linux
      nodeSelector:
        kubernetes.io/os: linux
      container:
        image: alpine
        command: [echo]
        args: ["Hello from Linux Container!"]

마찬가지로 이 예제를 실행하고 로그를 확인할 수 있습니다:

$ argo submit --watch https://raw.githubusercontent.com/argoproj/argo-workflows/main/examples/hello-hybrid.yaml
$ argo logs hello-hybrid-plqpp
hello-hybrid-plqpp-1977432187: "Hello from Windows Container!"
hello-hybrid-plqpp-764774907: Hello from Linux Container!

아티팩트 마운트 경로 (Artifact mount path)

아티팩트는 Linux에서와 거의 같은 방식으로 동작합니다. 모든 경로는 자동으로 C: 드라이브에 매핑됩니다. 예를 들어:

 # ...
    - name: print-message
      inputs:
        artifacts:
          # unpack the message input artifact
          # and put it at C:\message
          - name: message
            path: "/message" # gets mapped to C:\message
      nodeSelector:
        kubernetes.io/os: windows
      container:
        image: mcr.microsoft.com/windows/nanoserver:1809
        command: ["cmd", "/c"]
        args: ["dir C:\\message"]   # List the C:\message directory

Windows에서 볼륨 마운트는 컨테이너 내 개별 파일이 아니라 디렉터리만 대상으로 할 수 있다는 점을 기억하세요.

제한 사항 (Limitations)

  • 프로세스 네임스페이스 공유는 Windows에서 동작하지 않으므로, PNS(Process Namespace Sharing) 워크플로 실행기를 사용할 수 없습니다.
  • 실행기 Windows 컨테이너는 Nano Server를 베이스 이미지로 빌드됩니다. 더 최신 Windows 버전(예: 1909)에서 동작한다는 것은 현재 확인되지 않았습니다. 이것이 필요하다면 베이스 이미지를 먼저 조정해서 실행기 컨테이너를 직접 빌드해야 합니다.

Windows용 워크플로 실행기 이미지 빌드

Windows용 워크플로 실행기 이미지를 빌드하려면 문서에서 설명하는 것처럼 Docker가 설치된 Windows Server 2019 머신이 필요합니다.

그런 다음 프로젝트를 클론하고 Windows용 Dockerfile과 argoexec를 대상으로 Docker 빌드를 실행합니다:

git clone https://github.com/argoproj/argo-workflows.git
cd argo
docker build -t myargoexec -f .\Dockerfile.windows --target argoexec .

더 알아보기 (Learn more)

  • 컨트롤러와 서버는 Linux 전용이지만, 실행기(argoexec)는 Windows 노드에서 동작합니다.
  • kubernetes.io/os 노드 셀렉터로 단계별 OS를 지정하는 것이 하이브리드 워크플로의 핵심입니다.
  • Windows에서 아티팩트 경로는 자동으로 C: 드라이브로 매핑되고, 볼륨 마운트는 디렉터리만 가능합니다.