-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeployment.yml
More file actions
58 lines (55 loc) · 1.35 KB
/
Copy pathdeployment.yml
File metadata and controls
58 lines (55 loc) · 1.35 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
# Made by: Henrik Lagrosen
apiVersion: apps/v1 # specifies kubernetes api version
kind: Deployment
metadata:
name: backend-deployment
labels:
app: backend
spec:
replicas: 1
selector:
matchLabels:
app: backend
template:
metadata:
labels:
app: backend
spec:
imagePullSecrets: # uses the docker-registry secret to access the private registry
- name: docker-registry
containers:
- name: backend
image: registry.git.chalmers.se/courses/dit826/2024/group1/backend:latest
ports:
- containerPort: 8000
env:
- name: RUN_MODE
value: "prod" # allowed values are "dev" and "prod"
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: db-credentials
key: DB_PASSWORD
livenessProbe:
httpGet:
path: /
port: 8000
initialDelaySeconds: 30
periodSeconds: 15
timeoutSeconds: 6
failureThreshold: 3
---
apiVersion: v1
kind: Service
metadata:
name: backend-service
labels:
app: backend
spec:
type: LoadBalancer
selector:
app: backend
ports:
- protocol: TCP
port: 80 # the port the service listens on
targetPort: 8000 # the port the container listens on