← 返回列表

k8s: 多模态文生图

kind: Deployment
apiVersion: apps/v1
metadata:
  name: inference-abcccae1-94fd-4d7c-8e8d-376e6948e601
  namespace: topsec-poc
spec:
  replicas: 1
  selector:
    matchLabels:
      inference: inference-abcccae1-94fd-4d7c-8e8d-376e6948e601
  template:
    metadata:
      labels:
        inference: inference-abcccae1-94fd-4d7c-8e8d-376e6948e601
    spec:
      volumes:
        - name: shm-vol
          emptyDir:
            medium: Memory
            sizeLimit: 20Gi
        - name: container-default-volume
          persistentVolumeClaim:
            claimName: nfs-pvc
      containers:
        - name: container1
          image: '10.30.15.56:5000/intelligent/comfyui:2.9.0-cuda12.8-cudnn9-runtime'
          command:
            - /bin/sh
          args:
            - '-c'
            - |

              python3 /workspace/ComfyUI/main.py --listen 0.0.0.0 --port 8188 &
              until curl -sf curl -sf http://127.0.0.1:8188/; do
                sleep 1
              done
              exec /gateway \
                --listen :27600 \
                --comfy http://127.0.0.1:8188 \
                --assets /workspace/ComfyUI/assets/Z-Image-Turbo
          env:
            - name: MODELSCOPE_CACHE
              value: /home/data/modelscope
          resources:
            limits:
              nvidia.com/gpu: '1'
            requests:
              nvidia.com/gpu: '1'
          volumeMounts:
            - name: shm-vol
              mountPath: /dev/shm
            - name: container-default-volume
              mountPath: /workspace/ComfyUI/models
              subPath: ComfyUI/models
            - name: container-default-volume
              mountPath: /workspace/ComfyUI/assets
              subPath: ComfyUI/assets
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: IfNotPresent
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      nodeSelector:
        gpu_core_mode: whole
      securityContext: {}
      schedulerName: default-scheduler
      runtimeClassName: nvidia
  strategy:
    type: Recreate
  revisionHistoryLimit: 10
  progressDeadlineSeconds: 600