mirror of
https://github.com/RYDE-WORK/Langchain-Chatchat.git
synced 2026-01-19 21:37:20 +08:00
91 lines
1.8 KiB
YAML
91 lines
1.8 KiB
YAML
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 |