-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathauth-service.yaml
97 lines (97 loc) · 2.43 KB
/
auth-service.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: apps/v1
kind: Deployment
metadata:
name: auth-service
namespace: auth
labels:
app: auth-service
spec:
replicas: 1
selector:
matchLabels:
app: auth-service
template:
metadata:
labels:
app: auth-service
spec:
containers:
- name: auth-service
image: dustlightcn/auth-service:latest
# 配置 SMTP 服务后开启健康检查,否则检查将失败。
# livenessProbe:
# failureThreshold: 3
# httpGet:
# path: /actuator/health
# port: 8080
# scheme: HTTP
# initialDelaySeconds: 70
# periodSeconds: 70
# successThreshold: 1
# timeoutSeconds: 1
# readinessProbe:
# failureThreshold: 3
# httpGet:
# path: /actuator/health
# port: 8080
# scheme: HTTP
# initialDelaySeconds: 70
# periodSeconds: 10
# successThreshold: 1
# timeoutSeconds: 1
ports:
- containerPort: 8080
name: auth-port
volumeMounts:
- name: config
mountPath: /application.yaml
subPath: application.yaml
- name: auth-data
mountPath: /upload/auth
initContainers:
- name: init-cache
image: busybox
imagePullPolicy: IfNotPresent
command: [ 'sh', '-c', "until nc -z auth-cache 6379; do echo waiting for cache; sleep 2; done" ]
- name: init-database
image: busybox
imagePullPolicy: IfNotPresent
command: [ 'sh', '-c', "until nc -z auth-database 3306; do echo waiting for database; sleep 2; done" ]
volumes:
- name: config
configMap:
name: auth-service-config
items:
- key: application.yaml
path: application.yaml
- name: auth-data
persistentVolumeClaim:
claimName: auth-data
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: auth-data
namespace: auth
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Gi
---
apiVersion: v1
kind: Service
metadata:
name: auth-service
namespace: auth
labels:
app: auth-service
spec:
ports:
- port: 80
targetPort: 8080
name: auth-port
selector:
app: auth-service
type: ClusterIP