-
Notifications
You must be signed in to change notification settings - Fork 1
/
deployment.yaml
86 lines (86 loc) · 2.58 KB
/
deployment.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
apiVersion: apps/v1
kind: Deployment
metadata:
name: stable-diffusion-deployment
spec:
replicas: 1
selector:
matchLabels:
app: stable-diffusion-webui
template:
metadata:
labels:
app: stable-diffusion-webui
spec:
securityContext:
fsGroup: 1000
runtimeClassName: nvidia
initContainers:
- name: download-model
image: alpine:3.12
command: ['sh', '-c', 'if [ ! -e "/models/sd-v1-4.ckpt" ]; then wget https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt -P /models; fi; chown -R 1000:1000 /app']
volumeMounts:
- name: sd-model
mountPath: /models
- name: models
mountPath: /app/stable-diffusion/models
- name: outputs
mountPath: /app/stable-diffusion/outputs
- name: embeddings
mountPath: /app/stable-diffusion/embeddings
- name: extensions
mountPath: /app/stable-diffusion/extensions
containers:
- name: stable-diffusion-webui
image: ghcr.io/matthew-graves/stable-diffusion-webui-k8s:main
# imagePullPolicy: Always
volumeMounts:
- name: sd-model
mountPath: /models
- name: models
mountPath: /app/stable-diffusion/models
- name: outputs
mountPath: /app/stable-diffusion/outputs
- name: embeddings
mountPath: /app/stable-diffusion/embeddings
- name: extensions
mountPath: /app/stable-diffusion/extensions
- name: webui-conf
mountPath: /app/webui-user.sh
subPath: webui-user.sh
resources:
limits:
nvidia.com/gpu: 1
command: [ "/bin/bash", "webui.sh" ]
- name: filebrowser
image: filebrowser/filebrowser
volumeMounts:
- name: sd-model
mountPath: /srv/models
- name: models
mountPath: /srv/stable-diffusion/models
- name: outputs
mountPath: /srv/stable-diffusion/outputs
- name: embeddings
mountPath: /srv/stable-diffusion/embeddings
- name: extensions
mountPath: /srv/stable-diffusion/extensions
volumes:
- name: sd-model
hostPath:
path: /models
- name: outputs
hostPath:
path: /outputs
- name: models
hostPath:
path: /othermodels
- name: embeddings
hostPath:
path: /embeddings
- name: extensions
hostPath:
path: /extensions
- name: webui-conf
configMap:
name: webui-conf