Add Stable Diffusion - ComfyUI

This commit is contained in:
Joseph Hanson 2024-07-18 10:33:15 -05:00
parent 09bb62a3eb
commit 9a5dd3b499
Signed by: jahanson
SSH key fingerprint: SHA256:vy6dKBECV522aPAwklFM3ReKAVB086rT3oWwiuiFG7o
5 changed files with 133 additions and 0 deletions

View file

@ -8,3 +8,4 @@ resources:
# Flux-Kustomizations
- ./ollama/ks.yaml
- ./open-webui/ks.yaml
- ./stable-diffusion/ks.yaml

View file

@ -0,0 +1,82 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/main/charts/other/app-template/schemas/helmrelease-helm-v2beta2.schema.json
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: &app comfyui
spec:
interval: 30m
chart:
spec:
chart: app-template
version: 3.2.1
sourceRef:
kind: HelmRepository
name: bjw-s
namespace: flux-system
install:
remediation:
retries: 3
upgrade:
cleanupOnFail: true
remediation:
retries: 3
strategy: rollback
values:
controllers:
comfyui:
annotations:
reloader.stakater.com/auto: "true"
pod:
nodeSelector:
nvidia.com/gpu.present: "true"
runtimeClassName: nvidia
containers:
app:
image:
repository: docker.io/jahanson/comfyui
tag: v0.0.1
resources:
requests:
nvidia.com/gpu: 1 # requesting 1 GPU
cpu: 500m
memory: 2Gi
limits:
memory: 2Gi
nvidia.com/gpu: 1 # requesting 1 GPU
service:
app:
controller: comfyui
ports:
http:
port: 7860
ingress:
app:
enabled: true
className: internal-nginx
hosts:
- host: &host "{{ .Release.Name }}.jahanson.tech"
paths:
- path: /
service:
identifier: app
port: http
tls:
- hosts:
- *host
persistence:
models:
enabled: true
existingClaim: stablediffusion-checkpoints
globalMounts:
- path: /models
config:
enabled: true
existingClaim: comfyui
globalMounts:
- path: /data
output:
enabled: true
type: emptyDir
globalMounts:
- path: /output

View file

@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./helmrelease.yaml
- ./pvc.yaml
- ../../../../templates/volsync

View file

@ -0,0 +1,12 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: stablediffusion-checkpoints
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 300Gi
storageClassName: openebs-hostpath

View file

@ -0,0 +1,30 @@
---
# yaml-language-server: $schema=https://ks.hsn.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &app comfyui
namespace: flux-system
spec:
targetNamespace: ai
commonMetadata:
labels:
app.kubernetes.io/name: *app
dependsOn:
- name: nvidia-device-plugin
- name: node-feature-discovery
- name: volsync
- name: openebs
path: ./kubernetes/apps/ai/stable-diffusion/comfyui
prune: true
sourceRef:
kind: GitRepository
name: homelab
wait: false
interval: 30m
retryInterval: 1m
timeout: 5m
postBuild:
substitute:
APP: *app
VOLSYNC_CAPACITY: 5Gi