diff --git a/k8s/apps/comfyui/app.yaml b/k8s/apps/comfyui/app.yaml new file mode 100644 index 0000000..5421b0e --- /dev/null +++ b/k8s/apps/comfyui/app.yaml @@ -0,0 +1,20 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: comfyui + namespace: argocd +spec: + project: core + destination: + namespace: comfyui + server: https://kubernetes.default.svc + source: + repoURL: ssh://git@gt.hexor.cy:30022/ab/homelab.git + targetRevision: HEAD + path: k8s/apps/comfyui + syncPolicy: + automated: + selfHeal: true + prune: true + syncOptions: + - CreateNamespace=true diff --git a/k8s/apps/comfyui/deployment.yaml b/k8s/apps/comfyui/deployment.yaml new file mode 100644 index 0000000..ddde40e --- /dev/null +++ b/k8s/apps/comfyui/deployment.yaml @@ -0,0 +1,45 @@ +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 + nodeSelector: + kubernetes.io/hostname: uk-desktop.tail2fe2d.ts.net + # Fix permissions mismatch usually happening when mapping host paths + securityContext: + runAsUser: 0 + containers: + - name: comfyui + image: ghcr.io/ai-dock/comfyui:latest-cuda + imagePullPolicy: IfNotPresent + env: + - name: CLI_ARGS + value: "--listen 0.0.0.0 --port 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 diff --git a/k8s/apps/comfyui/kustomization.yaml b/k8s/apps/comfyui/kustomization.yaml new file mode 100644 index 0000000..8d419de --- /dev/null +++ b/k8s/apps/comfyui/kustomization.yaml @@ -0,0 +1,9 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - namespace.yaml + - local-pv.yaml + - pvc.yaml + - deployment.yaml + - service.yaml diff --git a/k8s/apps/comfyui/local-pv.yaml b/k8s/apps/comfyui/local-pv.yaml new file mode 100644 index 0000000..96450fb --- /dev/null +++ b/k8s/apps/comfyui/local-pv.yaml @@ -0,0 +1,22 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: comfyui-data-pv +spec: + capacity: + storage: 200Gi + volumeMode: Filesystem + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + storageClassName: local-path + local: + path: /data/comfyui + nodeAffinity: + required: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/hostname + operator: In + values: + - uk-desktop.tail2fe2d.ts.net diff --git a/k8s/apps/comfyui/namespace.yaml b/k8s/apps/comfyui/namespace.yaml new file mode 100644 index 0000000..450976d --- /dev/null +++ b/k8s/apps/comfyui/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: comfyui diff --git a/k8s/apps/comfyui/pvc.yaml b/k8s/apps/comfyui/pvc.yaml new file mode 100644 index 0000000..e328c89 --- /dev/null +++ b/k8s/apps/comfyui/pvc.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: comfyui-data-pvc + namespace: comfyui +spec: + accessModes: + - ReadWriteOnce + storageClassName: local-path + resources: + requests: + storage: 200Gi diff --git a/k8s/apps/comfyui/service.yaml b/k8s/apps/comfyui/service.yaml new file mode 100644 index 0000000..cb88d9e --- /dev/null +++ b/k8s/apps/comfyui/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: comfyui + namespace: comfyui + labels: + app: comfyui +spec: + ports: + - name: http + port: 8188 + targetPort: 8188 + protocol: TCP + selector: + app: comfyui