-
Notifications
You must be signed in to change notification settings - Fork 22
/
ibutsu_pod.yaml
153 lines (148 loc) · 3.39 KB
/
ibutsu_pod.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# for use with podman play
---
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: ibutsu
name: ibutsu-db-config
data: # todo: remove prefixes once podman supports prefixes natively
POSTGRES_DB: ibutsu
POSTGRES_USER: ibutsu
POSTGRES_PASSWORD: ibutsu # todo: move to a secret once podman supports those
POSTGRES_HOSTNAME: ibutsu
---
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: ibutsu
name: ibutsu-superuser-config
data: # todo: remove prefixes once podman supports prefixes natively
IBUTSU_SUPERADMIN_EMAIL: ibutsu@example.com
IBUTSU_SUPERADMIN_PASSWORD: abc123
IBUTSU_SUPERADMIN_OWN_PROJECT: test
---
apiVersion: v1
kind: Pod
metadata:
labels:
app: ibutsu
name: ibutsu
spec:
containers:
- name: postgres
image: docker.io/library/postgres:latest
resources: &resources-small
requests:
memory: "128Mi"
cpu: "250m"
limits:
memory: "512Mi"
cpu: "500m"
volumeMounts:
- name: ibutsu-database
mountPath: /var/lib/postgresql/data
envFrom:
- configMapRef:
name: ibutsu-db-config
- name: redis
image: docker.io/library/redis:latest
resources: *resources-small
volumeMounts:
- name: ibutsu-redis
mountPath: /data
- name: backend
image: backend
args: [ devserver]
env:
- name: JWT_SECRET
value: insecure-devserver-value
- name: CELERY_BROKER_URL
value: redis://ibutsu
- name: CELERY_RESULT_BACKEND
value: redis://ibutsu
envFrom:
- configMapRef:
name: ibutsu-db-config
prefix: POSTGRESQL_
- configMapRef:
name: ibutsu-superuser-config
resources: *resources-small
securityContext: &security-context
readOnlyRootFilesystem: false
seLinuxOptions: {}
volumeMounts:
- mountPath: /srv/:Z
name: ibutsu-server-backend
ports:
- containerPort: 8080
hostPort: 8080
livenessProbe:
httpGet:
path: /
port: 8080
initialDelaySeconds: 5
periodSeconds: 5
- name: worker
image: backend
args:
- worker
env:
- name: CELERY_BROKER_URL
value: redis://ibutsu
- name: CELERY_RESULT_BACKEND
value: redis://ibutsu
envFrom:
- configMapRef:
name: ibutsu-db-config
resources: *resources-small
securityContext: *security-context
volumeMounts:
- mountPath: /srv/:Z
name: ibutsu-server-backend
- name: frontend
image: docker.io/library/node:latest
args:
- /bin/bash
- -c
- |-
yarn install && CI=TRUE yarn run devserver
env:
- name: NODE_OPTIONS
value: --openssl-legacy-provider
- name: CI
value: "true"
resources:
requests:
memory: "128Mi"
cpu: "250m"
limits:
memory: "768Mi"
cpu: "500m"
ulimit: 20000
securityContext:
privileged: false
readOnlyRootFilesystem: false
volumeMounts:
- mountPath: /src/:Z
name: ibutsu-server-frontend
ports:
- containerPort: 3000
hostPort: 3000
workingDir: /src/
volumes:
- hostPath:
path: ./backend
type: Directory
name: ibutsu-server-backend
- hostPath:
path: ./frontend
type: Directory
name: ibutsu-server-frontend
- name: ibutsu-database
persistentVolumeClaim:
claimName: ibutsu-database
- name: ibutsu-redis
persistentVolumeClaim:
claimName: ibutsu-redis