diff --git a/ingress.yaml b/ingress.yaml new file mode 100644 index 0000000..ea86d8a --- /dev/null +++ b/ingress.yaml @@ -0,0 +1,22 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: ${deployment:=comfyui} + namespace: ${namespace:=comfyui} + annotations: + haproxy-ingress.github.io/rewrite: / + 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} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: ${deployment:=comfyui} + port: + name: http diff --git a/sts.yaml b/sts.yaml new file mode 100644 index 0000000..a63db48 --- /dev/null +++ b/sts.yaml @@ -0,0 +1,52 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + labels: + app: ${deployment:=comfyui} + name: ${deployment:=comfyui} + namespace: ${deployment:=comfyui} +spec: + replicas: 1 + serviceName: ${deployment:=comfyui} + selector: + matchLabels: + app: ${deployment:=comfyui} + template: + metadata: + labels: + app: ${deployment:=comfyui} + spec: + securityContext: + runAsUser: 1000 + runAsGroup: 1000 + fsGroup: 1000 + containers: + - name: ${deployment:=comfyui} + image: git.strudelline.net/cascade/docker-comfyui:v0.2.2 + resources: + requests: + cpu: "${cpu_request:=4}" + memory: "${memory_request:=23Gi}" + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + ports: + - containerPort: 7865 + name: http + protocol: TCP + volumeMounts: + - mountPath: /content/data + name: ${deployment:=comfyui}-data + runtimeClassName: "${runtime_class:=nvidia}" + nodeSelector: + nvidia.com/gpu.family: ampere + restartPolicy: Always + terminationGracePeriodSeconds: 300 + volumeClaimTemplates: + - metadata: + name: ${deployment:=comfyui}-data + spec: + accessModes: ["ReadWriteOnce"] + storageClassName: "${storage_class:=nvme}" + resources: + requests: + storage: ${volume_size:=256Gi} diff --git a/svc.yaml b/svc.yaml new file mode 100644 index 0000000..9bd3868 --- /dev/null +++ b/svc.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: ${deployment:=comfyui} + name: ${deployment:=comfyui} + namespace: ${namespace:=comfyui} +spec: + ports: + - port: 80 + targetPort: http + name: http + selector: + app: ${deployment:=comfyui} + type: ClusterIP