forked from chatchat-space/Langchain-Chatchat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
langchain_sample.yaml
91 lines (91 loc) · 1.83 KB
/
langchain_sample.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: PersistentVolume
metadata:
name: langchain-pv
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
storageClassName: standard
local:
path: /home/langchain #填入代码所在的目录
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- instance-1
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: langchain-pvc
spec:
accessModes:
- ReadWriteMany
storageClassName: standard
resources:
requests:
storage: 10Gi
volumeName: langchain-pv
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: langchain
spec:
replicas: 1
selector:
matchLabels:
app: langchain
template:
metadata:
labels:
app: langchain
spec:
securityContext:
fsGroup: 101
containers:
- name: langchain
image:{image_name}:{image_tag} #填入镜像名称与版本号
command: ["python"]
args: ["startup.py","-a"] #启动命令
ports:
- containerPort: 8501
- containerPort: 7861
- containerPort: 20000
volumeMounts:
- name: langchain-vol
mountPath: /Langchain-Chatchat
nodeSelector:
kubernetes.io/hostname: instance-1
volumes:
- name: langchain-vol
persistentVolumeClaim:
claimName: langchain-pvc
---
apiVersion: v1
kind: Service
metadata:
name: langchain-service
spec:
selector:
app: langchain
type: NodePort
ports:
- name: webui
port: 8501
targetPort: 8501
nodePort: 8501
- name: api
port: 7861
targetPort: 7861
nodePort: 7861
- name: fastchat
port: 20000
targetPort: 20000
nodePort: 20000