-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtempberry-backend.yaml
74 lines (65 loc) · 1.63 KB
/
tempberry-backend.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
apiVersion: apps/v1
kind: Deployment
metadata:
name: tempberry-backend
labels:
app: tempberry
tier: backend
spec:
replicas: 2
selector:
matchLabels:
tier: backend
template:
metadata:
labels:
tier: backend
spec:
containers:
- name: tempberry-backend
image: ckreuzberger/tempberry-backend:master
imagePullPolicy: Always
# remove comment in next line to pull image from local cache
# imagePullPolicy: Never
ports:
- containerPort: 8000
env:
- name: DATABASE_USER
valueFrom:
secretKeyRef:
name: postgres-credentials
key: user
- name: DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: postgres-credentials
key: password
- name: DATABASE_NAME
value: "tempberry"
- name: DATABASE_HOST
value: "postgres"
- name: DATABASE_URL
value: postgres://$(DATABASE_USER):$(DATABASE_PASSWORD)@$(DATABASE_HOST)/$(DATABASE_NAME)
- name: DJANGO_SETTINGS_MODULE
value: "tempBerry.settings.live"
- name: DJANGO_ALLOWED_HOSTS
value: "tempberry.somehost.com"
- name: SECRET_KEY
value: "TODO_ADD_KEY_HERE"
---
# [START service]
apiVersion: v1
kind: Service
metadata:
name: tempberry-backend-service
labels:
tier: backend
spec:
# type: LoadBalancer # note: use type loadbalancer if you want to expose it using a loadbalancer
ports:
- port: 80
protocol: "TCP"
targetPort: 8000
selector:
tier: backend
# [END service]