-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathkubernetes.yaml
78 lines (78 loc) · 1.51 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
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: flaskapp
name: flaskapp
spec:
replicas: 2
selector:
matchLabels:
app: flaskapp
template:
metadata:
labels:
app: flaskapp
spec:
terminationGracePeriodSeconds: 60
containers:
- image: albertoal/flask_webapp:0.3
name: flaskapp
env:
- name: FLASK_APP
value: "app.py"
# Change to development to enable debug mode
- name: FLASK_ENV
value: "production"
ports:
- containerPort: 5000
resources:
requests:
cpu: 50m
memory: 128Mi
limits:
cpu: 100m
memory: 256Mi
readinessProbe:
httpGet:
path: /ready
port: 5000
initialDelaySeconds: 15
periodSeconds: 5
livenessProbe:
httpGet:
path: /alive
port: 5000
initialDelaySeconds: 20
periodSeconds: 5
---
apiVersion: v1
kind: Service
metadata:
name: flaskapp
labels:
app: flaskapp
spec:
ports:
- port: 80
protocol: TCP
name: http
targetPort: 5000
selector:
app: flaskapp
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: flaskapp
annotations:
# Disables http redirect to https
nginx.ingress.kubernetes.io/ssl-redirect: "false"
spec:
rules:
- http:
paths:
- path: /
backend:
serviceName: flaskapp
servicePort: 80