Repository navigation
Expand file tree
/
Copy pathdev.pod.yml.example
More file actions
201 lines (186 loc) · 4.64 KB
/
Copy pathdev.pod.yml.example
File metadata and controls
201 lines (186 loc) · 4.64 KB
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
apiVersion: v1
kind: Pod
metadata:
name: trainstatus-dev
spec:
containers:
- name: postgis
image: docker.io/postgis/postgis:18-3.6-alpine
env:
- name: POSTGRES_USER
value: "trains"
- name: POSTGRES_PASSWORD
value: "trains"
- name: POSTGRES_DB
value: "trains"
ports:
- containerPort: 5432
hostPort: 5432
volumeMounts:
- name: trainstatus-db-dev
mountPath: /var/lib/postgresql
- name: postgresql-config
mountPath: /etc/postgresql/postgresql.conf
subPath: postgresql.conf
readOnly: true
- name: postgis-shm
mountPath: /dev/shm
resources:
requests:
cpu: "250m"
memory: "512Mi"
limits:
cpu: "1000m"
memory: "1Gi"
livenessProbe:
exec:
command:
- pg_isready
- -U
- trains
- -d
- trains
initialDelaySeconds: 5
periodSeconds: 5
- name: martin
image: ghcr.io/maplibre/martin:latest
env:
- name: DATABASE_URL
value: "postgresql://trains:trains@127.0.0.1:5432/trains"
args:
- --config
- /config/martin.yml
ports:
- containerPort: 3000
hostPort: 3000
volumeMounts:
- name: geo-data
mountPath: /data
readOnly: true
- name: geo-assets
mountPath: /assets
readOnly: true
- name: martin-config
mountPath: /config/martin.yml
subPath: martin.yml
readOnly: true
resources:
requests:
cpu: "100m"
memory: "128Mi"
limits:
cpu: "500m"
memory: "512Mi"
# Optional Datadog: copy dev.configmap.yml.example to dev.configmap.yml,
# set the API key, then uncomment this container. Recreate the pod to apply.
# - name: datadog
# image: registry.datadoghq.com/agent:7
# env:
# - name: DD_API_KEY
# valueFrom:
# configMapKeyRef:
# name: datadog-config-dev
# key: DD_API_KEY
# - name: DD_SITE
# value: "us5.datadoghq.com"
# - name: DD_ENV
# value: "development"
# - name: DD_HOSTNAME
# value: "trainstatus-local"
# - name: DD_OTLP_CONFIG_RECEIVER_PROTOCOLS_HTTP_ENDPOINT
# value: "0.0.0.0:4318"
# - name: DD_LOGS_ENABLED
# value: "true"
# - name: DD_OTLP_CONFIG_LOGS_ENABLED
# value: "true"
# ports:
# - containerPort: 4318
# hostPort: 4318
# hostIP: "127.0.0.1"
# resources:
# requests:
# cpu: "250m"
# memory: "256Mi"
# limits:
# cpu: "1000m"
# memory: "1Gi"
volumes:
- name: geo-data
image:
reference: ghcr.io/jonerrr/trainstatus-geo-data:latest
pullPolicy: Never
- name: geo-assets
image:
reference: ghcr.io/jonerrr/trainstatus-geo-assets:latest
pullPolicy: Never
- name: trainstatus-db-dev
persistentVolumeClaim:
claimName: trainstatus-db-dev
- name: martin-config
configMap:
name: martin-config-dev
- name: postgresql-config
configMap:
name: postgresql-config-dev
- name: postgis-shm
emptyDir:
medium: Memory
sizeLimit: 1Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: trainstatus-db-dev
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: ConfigMap
metadata:
name: martin-config-dev
data:
martin.yml: |-
route_prefix: /martin
convert_to_mlt: auto
postgres:
# The connection URL will be read from DATABASE_URL env var
connection_string: $DATABASE_URL
reload_interval: 30s
auto_publish:
tables: false
functions:
from_schemas:
- realtime
sprites:
paths:
- /assets/sprites/dark-matter
- /assets/sprites/frontend
styles:
sources:
dark-matter: /assets/styles/dark-matter.json
fonts:
paths:
- /assets/fonts
mbtiles:
sources:
basemap: /data/basemap.mbtiles
# should be disabled in prod
web_ui: enable-for-all
cors: true
---
apiVersion: v1
kind: ConfigMap
metadata:
name: postgresql-config-dev
data:
postgresql.conf: |-
log_statement = 'all'
log_min_error_statement = 'error'
log_min_messages = 'error'
logging_collector = on
log_directory = 'pg_log'
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'