-
Notifications
You must be signed in to change notification settings - Fork 4
/
k8s-deployment.zadig
113 lines (113 loc) · 2.43 KB
/
k8s-deployment.zadig
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
apiVersion: apps/v1
kind: Deployment
metadata:
name: visual-ddd-client
spec:
selector:
matchLabels:
app: visual-ddd-client
replicas: 1
template:
metadata:
labels:
app: visual-ddd-client
spec:
containers:
- name: visual-ddd-client
image: 172.26.59.200/wkfe/visual-ddd:latest
ports:
- containerPort: 3000
name: server
- containerPort: 9229
name: debug
env:
# 后端服务地址
- name: BACKEND
value: {{ .BACKEND }}
# session 密钥
- name: SESSION_SECRET
value: {{ .SECRET }}
# NODE 配置
# 配置为 --inspect=0.0.0.0 打开debugger 服务
- name: NODE_OPTIONS
value: {{ .NODE_OPTIONS }}
# AI 配置
- name: AI_CONFIGURATION
value: {{ .AI_CONFIGURATION }}
# 多人协作服务
- name: visual-ddd-collab
image: wkfe/visual-ddd-collab:latest
ports:
- containerPort: 9090
env:
- name: MAIN_SERVER
value: http://visual-ddd-client:80
---
# 客户端服务
apiVersion: v1
kind: Service
metadata:
name: visual-ddd-client
spec:
selector:
app: visual-ddd-client
ports:
- protocol: TCP
port: 80
targetPort: 3000
type: NodePort
---
# 多人协作服务
apiVersion: v1
kind: Service
metadata:
name: visual-ddd-collab
spec:
selector:
app: visual-ddd-client
ports:
- protocol: TCP
port: 80
targetPort: 9090
type: NodePort
---
# debugger
apiVersion: v1
kind: Service
metadata:
name: visual-ddd-debugger
spec:
selector:
app: visual-ddd-client
ports:
- protocol: TCP
port: 9229
targetPort: 9229
type: NodePort
---
# ingress
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: visual-ddd-ingress
labels:
app.kubernetes.io/name: visual-ddd-ingress
spec:
rules:
- host: {{ .HOST }}
http:
paths:
- backend:
serviceName: visual-ddd-client
servicePort: 80
path: /
pathType: ImplementationSpecific
- backend:
serviceName: visual-ddd-collab
servicePort: 80
path: /collaboration
pathType: ImplementationSpecific
tls:
- hosts:
- {{ .HOST }}
secretName: wakedt