-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfallback-svc.yaml
49 lines (49 loc) · 1.13 KB
/
fallback-svc.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
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: fallback-svc
namespace: app
spec:
replicas:
selector:
matchLabels:
app: fallback-svc
template:
metadata:
labels:
app: fallback-svc
spec:
containers:
- image: 12345678910112.dkr.ecr.eu-west-2.amazonaws.com/app:v1.0 #getting the docker image from aws ecr. You can relace this with whatever you use to store your images. I use ecr as it works really well with automated deployments via GitHub actions.
imagePullPolicy: Always
name: fallback-svc
ports:
- containerPort: 80
livenessProbe:
tcpSocket:
port: 80
initialDelaySeconds: 30
periodSeconds: 5
timeoutSeconds: 2
resources:
limits:
cpu: 512m
memory: 1024Mi
requests:
cpu: 256m
memory: 512m
---
apiVersion: v1
kind: Service
metadata:
namespace: app
name: fallback-svc
spec:
type: NodePort #allow external traffic to each my service.
selector:
app: fallback-svc
ports:
- port: 80
targetPort: 80
protocol: TCP