-
Notifications
You must be signed in to change notification settings - Fork 0
/
kubernetes.yaml
97 lines (94 loc) · 2.01 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
92
93
94
95
96
97
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: gold
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: jingdong-financial
spec:
replicas: 1
selector:
matchLabels:
app: jingdong-financial
template:
metadata:
labels:
app: jingdong-financial
spec:
containers:
- name: flask-service
env:
- name: RUNTIME_ENV
value: 'PROD'
- name: TZ
value: "Asia/Shanghai"
- name: HTTP_PROXY
value: http://127.0.0.1:7610
- name: HTTPS_PROXY
value: http://127.0.0.1:7610
- name: NO_PROXY
value: "local.domain,*.local.domain,ms.jr.jd.com,*.jd.com"
image: 1995chen/jingdong_financial: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: gold
---
apiVersion: v1
kind: Service
metadata:
name: jingdong-financial
spec:
ports:
- port: 80
targetPort: 8080
selector:
app: jingdong-financial
type: ClusterIP
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: gold.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: gold.local.domain
http:
paths:
- backend:
serviceName: jingdong-financial
servicePort: 80
tls:
- hosts:
- gold.local.domain
secretName: gold