콘텐츠로 이동

NPU Pod에서 RDS 장치 확인하기

RDS(Rebellions Direct Storage)는 Rebel100™에서만 지원됩니다. NPU를 할당받은 Pod에서 RDS 장치 파일을 확인합니다.

이 튜토리얼은 Helm 구성 예제의 RDS를 기준으로 합니다. Operator가 아직 설치되어 있지 않다면 먼저 NPU Operator 설치 절차를 진행합니다.

튜토리얼을 시작하기 전에 RDS 지원 문서에 따라 사용할 NVMe를 지정하고 대상 노드에서 RDS를 활성화해야 합니다.

1. NPU Pod 생성하기

npu-tutorial 네임스페이스를 만들고 RDS를 설정한 노드에서 NPU 1개를 요청합니다.

kubectl create namespace npu-tutorial --dry-run=client -o yaml | kubectl apply -f -
kubectl apply -f - <<'EOF'
apiVersion: resource.k8s.io/v1
kind: ResourceClaimTemplate
metadata:
  name: rds-npu
  namespace: npu-tutorial
spec:
  spec:
    devices:
      requests:
      - name: npu
        exactly:
          deviceClassName: npu.rebellions.ai
          count: 1
---
apiVersion: v1
kind: Pod
metadata:
  name: npu-rds
  namespace: npu-tutorial
spec:
  nodeSelector:
    rebellions.ai/npu.family: rebel100
    rebellions.ai/rds.present: "true"
  containers:
  - name: ubuntu
    image: ubuntu:22.04
    command: ["sleep", "infinity"]
    resources:
      claims:
      - name: npu
  resourceClaims:
  - name: npu
    resourceClaimTemplateName: rds-npu
EOF

2. NPU와 RDS 장치 확인하기

Pod가 준비되면 배치된 노드와 NPU, RDS 장치 파일을 확인합니다.

Pod 배치와 NPU
$ kubectl wait -n npu-tutorial --for=condition=Ready pod/npu-rds --timeout=180s
pod/npu-rds condition met

$ kubectl get pod -n npu-tutorial npu-rds \
  -o 'custom-columns=NAME:.metadata.name,NODE:.spec.nodeName,PHASE:.status.phase'
NAME      NODE            PHASE
npu-rds   node-rebel100   Running

$ kubectl exec -n npu-tutorial npu-rds -- rbln-smi -L
NPU 0 : RBLN-CR13 (UUID: NPU-34428712-d887-840b-a7b9-1c9e05807fc3)

컨테이너의 /dev에서 rblnfsN 형식의 RDS 장치 이름을 조회합니다. N은 장치 번호입니다.

RDS 장치 확인
$ kubectl exec -n npu-tutorial npu-rds -- sh -c 'ls -1 /dev | grep -E "^rblnfs[0-9]+$"'
rblnfs0

NPU 1개와 rblnfsN 형식의 RDS 장치가 표시되면 성공입니다.

정리

Pod와 ResourceClaimTemplate을 삭제합니다. 템플릿에서 생성된 Claim은 자동으로 삭제됩니다.

kubectl delete pod -n npu-tutorial npu-rds
kubectl delete resourceclaimtemplate -n npu-tutorial rds-npu