diff --git a/deploy.yaml b/deploy-comfyui.yaml similarity index 94% rename from deploy.yaml rename to deploy-comfyui.yaml index a05765f..34feff1 100644 --- a/deploy.yaml +++ b/deploy-comfyui.yaml @@ -27,8 +27,8 @@ spec: imagePullPolicy: Always resources: requests: - cpu: "${cpu_request:=4}" - memory: "${memory_request:=23Gi}" + cpu: "${cpu_request:=2}" + memory: "${memory_request:=12Gi}" terminationMessagePath: /dev/termination-log terminationMessagePolicy: File ports: diff --git a/deploy-fooocus.yaml b/deploy-fooocus.yaml new file mode 100644 index 0000000..87847f7 --- /dev/null +++ b/deploy-fooocus.yaml @@ -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 diff --git a/ingress.yaml b/ingress-comfyui.yaml similarity index 87% rename from ingress.yaml rename to ingress-comfyui.yaml index ea86d8a..a549fae 100644 --- a/ingress.yaml +++ b/ingress-comfyui.yaml @@ -4,13 +4,13 @@ metadata: name: ${deployment:=comfyui} namespace: ${namespace:=comfyui} 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-signin: ${oauth2_proxy_base}/start?rd=https://%[hdr(host)]%[path] spec: ingressClassName: haproxy rules: - - host: ${hostname} + - host: comfy-${hostname} http: paths: - path: / diff --git a/ingress-fooocus.yaml b/ingress-fooocus.yaml new file mode 100644 index 0000000..eb9f50b --- /dev/null +++ b/ingress-fooocus.yaml @@ -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 diff --git a/svc.yaml b/svc-comfyui.yaml similarity index 100% rename from svc.yaml rename to svc-comfyui.yaml diff --git a/svc-fooocus.yaml b/svc-fooocus.yaml new file mode 100644 index 0000000..deb5974 --- /dev/null +++ b/svc-fooocus.yaml @@ -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