-
Notifications
You must be signed in to change notification settings - Fork 33
/
oba.yaml
128 lines (128 loc) · 2.8 KB
/
oba.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
apiVersion: v1
kind: Namespace
metadata:
name: oba
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: oba-database-deployment
namespace: oba
spec:
replicas: 1
selector:
matchLabels:
app: oba-database
template:
metadata:
labels:
app: oba-database
spec:
containers:
- name: oba-database
image: mysql:8.4
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: oba-secrets
key: MYSQL_ROOT_PASSWORD
- name: MYSQL_DATABASE
value: oba_database
- name: MYSQL_USER
value: oba_user
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: oba-secrets
key: MYSQL_PASSWORD
ports:
- containerPort: 3306
volumeMounts:
- mountPath: /var/lib/mysql
name: mysql-data
volumes:
- name: mysql-data
hostPath:
path: /var/lib/oba/mysql
---
apiVersion: v1
kind: Service
metadata:
name: oba-database
namespace: oba
spec:
selector:
app: oba-database
ports:
- protocol: TCP
port: 3306
targetPort: 3306
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: oba-app-deployment
namespace: oba
spec:
replicas: 1
selector:
matchLabels:
app: oba-app
template:
metadata:
labels:
app: oba-app
spec:
initContainers:
- name: oba-bundler
image: oba/bundler:test
env:
- name: GTFS_URL
valueFrom:
configMapKeyRef:
name: oba-configs
key: GTFS_URL
volumeMounts:
- mountPath: /bundle
name: bundle-volume
containers:
- name: oba-app
image: oba/app:test
env:
- name: JDBC_URL
value: jdbc:mysql://oba-database.oba.svc.cluster.local:3306/oba_database
- name: JDBC_USER
value: oba_user
- name: JDBC_PASSWORD
valueFrom:
secretKeyRef:
name: oba-secrets
key: JDBC_PASSWORD
ports:
- containerPort: 8080
volumeMounts:
- mountPath: /bundle
name: bundle-volume
volumes:
- name: bundle-volume
emptyDir: {}
---
apiVersion: v1
kind: Secret
metadata:
name: oba-secrets
namespace: oba
type: Opaque
data:
MYSQL_ROOT_PASSWORD: SW5zM2N1cmUh
MYSQL_PASSWORD: b2JhX3Bhc3N3b3Jk
JDBC_PASSWORD: b2JhX3Bhc3N3b3Jk
---
apiVersion: v1
kind: ConfigMap
metadata:
name: oba-configs
namespace: oba
data:
GTFS_URL: https://unitrans.ucdavis.edu/media/gtfs/Unitrans_GTFS.zip