-
Notifications
You must be signed in to change notification settings - Fork 0
/
kubernetes.yaml
91 lines (88 loc) · 1.8 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
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: flask-template
spec:
replicas: 1
selector:
matchLabels:
app: flask-template
template:
metadata:
labels:
app: flask-template
spec:
containers:
- name: flask-service
env:
- name: RUNTIME_ENV
value: 'PROD'
- name: TZ
value: "Asia/Shanghai"
image: 1995chen/flask-template:latest
ports:
- containerPort: 8080
volumeMounts:
- mountPath: /opt/application/logs
name: data
subPath: logs
livenessProbe:
httpGet:
path: /api/health
port: 8080
httpHeaders:
- name: LivenessProbe-Header
value: LivenessProbe
initialDelaySeconds: 5
periodSeconds: 3
restartPolicy: Always
volumes:
- name: data
persistentVolumeClaim:
claimName: data
---
apiVersion: v1
kind: Service
metadata:
name: flask-template
spec:
ports:
- port: 80
targetPort: 8080
selector:
app: flask-template
type: ClusterIP
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: flask-template.local.domain
annotations:
# redirect 时token过长导致502
nginx.ingress.kubernetes.io/proxy-buffer-size: "16k"
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/use-regex: "true"
spec:
rules:
- host: flask-template.local.domain
http:
paths:
- backend:
serviceName: flask-template
servicePort: 80
tls:
- hosts:
- flask-template.local.domain
secretName: flask-template