Files
homelab/k8s/apps/comfyui/deployment.yaml

64 lines
1.8 KiB
YAML
Raw Normal View History

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
2026-03-07 21:46:16 +00:00
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: ghcr.io/ai-dock/comfyui:latest-cuda
imagePullPolicy: IfNotPresent
env:
2026-03-07 21:48:18 +00:00
- name: COMFYUI_ARGS
2026-03-07 21:46:16 +00:00
value: "--listen 0.0.0.0"
- name: COMFYUI_PORT_LOCAL
value: "8188"
- name: COMFYUI_PORT_HOST
value: "8189"
- name: COMFYUI_EXTRA_PIP_PACKAGES
value: "--pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128 --upgrade"
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