Kubernetes를 사용하여 Nvidia Jetson Nano에 객체 감지 앱 배포

준비


  • JetPack 4.4 포함 NVIDIA Jetson Nano 4GB
  • Kubernetes >= 1.16
  • USB 카메라
  • 컨테이너 레지스트리 토큰
  • 액세스 가능한 이미지 만들기: docker pull dustynv/jetson-inference:r32.4.3

  • YAML 파일



    참고: 모든 리소스가 동일한 네임스페이스에 포함되어야 합니다: jetson-inference .

    전개

    apiVersion: apps/v1
    kind: Deployment
    metadata:
      creationTimestamp: null
      labels:
        app: jetson-inference
      name: jetson-inference
      namespace: jetson-inference
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: jetson-inference
      strategy: {}
      template:
        metadata:
          creationTimestamp: null
          labels:
            app: jetson-inference
        spec:
          hostNetwork: true
          containers:
          - image: my-harbor.io/public/jetson-inference:r32.4.3
            name: jetson-inference
            command: ["/jetson-inference/build/aarch64/bin/detectnet-camera.py"]
            args: ["--network=ssd-mobilenet-v2", "/dev/video0", "display://0"]
            env:
            - name: DISPLAY
              value: ":0.0"
            securityContext:
              privileged: true
            resources: {}
          imagePullSecrets:
            - name: harbor-secret
          nodeSelector:
            kubernetes.io/hostname: jetson-nano-01  # deploy the app to the specific device
    status: {}
    


    네임스페이스

    apiVersion: v1
    kind: Namespace
    metadata:
      creationTimestamp: null
      name: jetson-inference
    spec: {}
    status: {}
    


    비밀

    apiVersion: v1
    data:
      .dockerconfigjson: <YOUR-DOCKER-AUTH-STRING>
    kind: Secret
    metadata:
      creationTimestamp: null
      name: harbor-secret
      namespace: jetson-inference
    type: kubernetes.io/dockerconfigjson
    


    참조


  • 특정 노드에 포드 할당https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/
  • ImagePull 비밀https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod
  • CMD, 인수https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/
  • 환경 https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/
  • 좋은 웹페이지 즐겨찾기