This repository has been archived by the owner on Sep 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathkubernetes.yaml
199 lines (199 loc) · 3.78 KB
/
kubernetes.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
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
---
apiVersion: v1
kind: Secret
metadata:
name: postgres-credentials
type: Opaque
data:
POSTGRES_USER: <user>
POSTGRES_PASSWORD: <password>
POSTGRES_DB: Y2FsdW1h
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: postgres-pv-volume
labels:
type: local
app: postgres
spec:
storageClassName: manual
capacity:
storage: 5Gi
accessModes:
- ReadWriteMany
hostPath:
path: "/mnt/data"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-pv-claim
labels:
app: postgres
spec:
storageClassName: manual
accessModes:
- ReadWriteMany
resources:
requests:
storage: 5Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
spec:
replicas: 1
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres:10.4
imagePullPolicy: "IfNotPresent"
ports:
- containerPort: 5432
envFrom:
- secretRef:
name: postgres-credentials
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: postgredb
volumes:
- name: postgredb
persistentVolumeClaim:
claimName: postgres-pv-claim
---
apiVersion: v1
kind: Service
metadata:
name: postgres
labels:
app: postgres
spec:
ports:
- port: 5432
selector:
app: postgres
---
apiVersion: v1
kind: Service
metadata:
name: caluma
labels:
app: caluma-backend
spec:
ports:
- port: 8000
selector:
app: caluma-backend
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: caluma-backend
labels:
app: caluma-backend
spec:
replicas: 1
selector:
matchLabels:
app: caluma-backend
template:
metadata:
labels:
app: caluma-backend
spec:
containers:
- name: caluma-backend
image: projectcaluma/caluma:latest
ports:
- containerPort: 8000
env:
- name: DATABASE_HOST
value: "postgres"
- name: DATABASE_PORT
value: "5432"
- name: DATABASE_USER
valueFrom:
secretKeyRef:
name: postgres-credentials
key: POSTGRES_USER
- name: DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: postgres-credentials
key: POSTGRES_PASSWORD
- name: SECRET_KEY
value: <Secret key>
- name: ALLOWED_HOSTS
value: "*"
- name: VISIBILITY_CLASSES
value: "caluma.caluma_core.visibilities.Any"
- name: PERMISSION_CLASSES
value: "caluma.caluma_core.permissions.AllowAny"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: caluma-demo
labels:
app: caluma-demo
spec:
replicas: 1
selector:
matchLabels:
app: caluma-demo
template:
metadata:
labels:
app: caluma-demo
spec:
containers:
- name: caluma-demo
image: projectcaluma/caluma-demo:stable
imagePullPolicy: Always
ports:
- containerPort: 80
env:
- name: ENV
value: development
---
apiVersion: v1
kind: Service
metadata:
name: caluma-frontend
labels:
app: caluma-demo
spec:
ports:
- port: 80
selector:
app: caluma-demo
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: demo-caluma-io
labels:
app: caluma-demo
annotations:
kubernetes.io/ingress.class: nginx
certmanager.k8s.io/cluster-issuer: letsencrypt-prod
cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
rules:
- host: demo.caluma.io
http:
paths:
- path: /
backend:
serviceName: caluma-frontend
servicePort: 80
tls:
- hosts:
- demo.caluma.io
secretName: demo-caluma-io-tls