-
Notifications
You must be signed in to change notification settings - Fork 1
/
database.yaml
57 lines (57 loc) · 1.02 KB
/
database.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
apiVersion: v1
data:
CreateDB.sql: |-
CREATE TABLE text (
id serial PRIMARY KEY,
text VARCHAR ( 100 ) UNIQUE NOT NULL
);
kind: ConfigMap
metadata:
name: pg-init-script
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
labels:
app: database
spec:
replicas: 1
selector:
matchLabels:
app: database
template:
metadata:
labels:
app: database
spec:
containers:
- name: postgres
image: postgres
ports:
- containerPort: 5432
volumeMounts:
- name: sqlscript
mountPath: /docker-entrypoint-initdb.d
env:
- name: POSTGRES_USER
value: "postgres"
- name: POSTGRES_PASSWORD
value: "postgres"
volumes:
- name: sqlscript
configMap:
name: pg-init-script
---
apiVersion: v1
kind: Service
metadata:
name: pg-service
labels:
app: database
spec:
type: ClusterIP
selector:
app: database
ports:
- port: 5432