-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkube.yaml
85 lines (81 loc) · 1.85 KB
/
kube.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
# kube config. Can be used with podman play.
# Before starting, build with: podman build . -t valhalla
# this file contains some example configurations containing credentials.
# if you use this in production, remember to change them.
---
apiVersion: v1
kind: ConfigMap
metadata:
name: postgresql-config
data:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_USER: valhalla
POSTGRES_DB: valhalla
---
apiVersion: v1
kind: ConfigMap
metadata:
name: valhalla-config
data:
SECRET_KEY: changeme
DATABASE_URL: postgresql+asyncpg://valhalla@valhalla-database/valhalla
PORT: "8080"
---
apiVersion: v1
kind: Pod
metadata:
name: valhalla
labels:
app: valhalla
spec:
containers:
- name: database
image: docker.io/postgres
volumeMounts:
- name: postgres-data
mountPath: /var/lib/postgresql/data
- name: postgres-sock
mountPath: /var/run/postgresql
envFrom:
- configMapRef:
name: postgresql-config
ports:
- protocol: TCP
containerPort: 5432
hostPort: 5432
- name: api
image: localhost/valhalla
volumeMounts:
- name: postgres-sock
mountPath: /var/run/postgresql
- name: textures
mountPath: /project/var/textures
env:
- name: TEXTURES_PATH
value: ./var/textures
envFrom:
- configMapRef:
name: valhalla-config
ports:
- protocol: TCP
containerPort: 8080
hostPort: 8080
volumes:
- name: postgres-data
persistentVolumeClaim:
claimName: postgres-data
- name: textures
persistentVolumeClaim:
claimName: textures
- name: postgres-sock
emptyDir: {}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-data
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: textures