apiVersion: apps/v1 kind: Deployment metadata: name: comfyui namespace: comfyui labels: app: comfyui spec: replicas: 1 selector: matchLabels: app: comfyui template: metadata: labels: app: comfyui spec: runtimeClassName: nvidia tolerations: - key: workload operator: Equal value: desktop effect: NoSchedule nodeSelector: kubernetes.io/hostname: uk-desktop.tail2fe2d.ts.net # Fix permissions mismatch usually happening when mapping host paths securityContext: runAsUser: 0 initContainers: - name: create-data-dir image: busybox command: ["sh", "-c", "mkdir -p /host.data && chown -R 1000:1000 /host.data"] volumeMounts: - name: data mountPath: /host.data containers: - name: comfyui image: runpod/comfyui:latest-5090 imagePullPolicy: IfNotPresent env: - name: COMFYUI_PORT value: "8188" ports: - containerPort: 8188 name: http protocol: TCP resources: limits: nvidia.com/gpu: 1 volumeMounts: - name: data # For ai-dock images, /workspace is the persistent user directory mountPath: /workspace volumes: - name: data persistentVolumeClaim: claimName: comfyui-data-pvc