add fooocus to the comfyui deployment

This commit is contained in:
James Andariese 2024-10-11 16:21:40 -05:00
parent 82b664978e
commit 222766d230
6 changed files with 123 additions and 4 deletions

View File

@ -27,8 +27,8 @@ spec:
imagePullPolicy: Always imagePullPolicy: Always
resources: resources:
requests: requests:
cpu: "${cpu_request:=4}" cpu: "${cpu_request:=2}"
memory: "${memory_request:=23Gi}" memory: "${memory_request:=12Gi}"
terminationMessagePath: /dev/termination-log terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File terminationMessagePolicy: File
ports: ports:

80
deploy-fooocus.yaml Normal file
View File

@ -0,0 +1,80 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: ${deployment:=gai}-fooocus
component: fooocus
name: ${deployment:=gai}-fooocus
namespace: ${deployment:=gai}
spec:
replicas: 1
selector:
matchLabels:
app: ${deployment:=gai}-fooocus
component: fooocus
strategy:
type: Recreate
template:
metadata:
labels:
app: ${deployment:=gai}-fooocus
component: fooocus
spec:
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
containers:
- name: fooocus
image: ghcr.io/lllyasviel/fooocus:latest
env:
- name: CMDARGS
value: --listen
- name: DATADIR
value: /content/data
- name: config_path
value: /content/data/config.txt
- name: config_example_path
value: /content/data/config_modification_tutorial.txt
- name: path_checkpoints
value: /content/data/models/checkpoints/
- name: path_loras
value: /content/data/models/loras/
- name: path_embeddings
value: /content/data/models/embeddings/
- name: path_vae_approx
value: /content/data/models/vae_approx/
- name: path_upscale_models
value: /content/data/models/upscale_models/
- name: path_inpaint
value: /content/data/models/inpaint/
- name: path_controlnet
value: /content/data/models/controlnet/
- name: path_clip_vision
value: /content/data/models/clip_vision/
- name: path_fooocus_expansion
value: /content/data/models/prompt_expansion/fooocus_expansion/
- name: path_outputs
value: /content/app/outputs/
resources:
requests:
cpu: "${cpu_request:=2}"
memory: "${memory_request:=12Gi}"
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
ports:
- containerPort: 7865
name: http
protocol: TCP
volumeMounts:
- mountPath: /content/data
name: data
runtimeClassName: "${runtime_class:=nvidia}"
nodeSelector:
nvidia.com/gpu.family: ampere
restartPolicy: Always
terminationGracePeriodSeconds: 300
volumes:
- name: data
persistentVolumeClaim:
claimName: ${deployment:=gai}-data

View File

@ -4,13 +4,13 @@ metadata:
name: ${deployment:=comfyui} name: ${deployment:=comfyui}
namespace: ${namespace:=comfyui} namespace: ${namespace:=comfyui}
annotations: annotations:
haproxy-ingress.github.io/rewrite: / haproxy-ingress.github.io/rewrite-target: /
haproxy-ingress.github.io/auth-url: ${oauth2_proxy_base}/auth haproxy-ingress.github.io/auth-url: ${oauth2_proxy_base}/auth
haproxy-ingress.github.io/auth-signin: ${oauth2_proxy_base}/start?rd=https://%[hdr(host)]%[path] haproxy-ingress.github.io/auth-signin: ${oauth2_proxy_base}/start?rd=https://%[hdr(host)]%[path]
spec: spec:
ingressClassName: haproxy ingressClassName: haproxy
rules: rules:
- host: ${hostname} - host: comfy-${hostname}
http: http:
paths: paths:
- path: / - path: /

22
ingress-fooocus.yaml Normal file
View File

@ -0,0 +1,22 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ${deployment:=gai}-fooocus
namespace: ${namespace:=gai}
annotations:
haproxy-ingress.github.io/rewrite-target: /
haproxy-ingress.github.io/auth-url: ${oauth2_proxy_base}/auth
haproxy-ingress.github.io/auth-signin: ${oauth2_proxy_base}/start?rd=https://%[hdr(host)]%[path]
spec:
ingressClassName: haproxy
rules:
- host: fooocus-${hostname}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: ${deployment:=gai}-fooocus
port:
name: http

17
svc-fooocus.yaml Normal file
View File

@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: ${deployment:=gai}-fooocus
component: fooocus
name: ${deployment:=gai}-fooocus
namespace: ${namespace:=gai}
spec:
ports:
- port: 80
targetPort: http
name: http
selector:
app: ${deployment:=gai}-fooocus
component: fooocus
type: ClusterIP