2024-08-07 00:53:00 +08:00
|
|
|
---
|
|
|
|
|
|
|
|
# 创建 Namespace
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Namespace
|
|
|
|
metadata:
|
|
|
|
name: hty1024-app
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
# 创建 Service
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
|
|
|
name: hty1024-app-chatgpt-next-web-service
|
|
|
|
namespace: hty1024-app
|
|
|
|
labels:
|
|
|
|
app.k8s.hty1024.com/env: prod
|
|
|
|
app.k8s.hty1024.com/type: app
|
|
|
|
app.k8s.hty1024.com/name: chatgpt-next-web
|
2024-11-11 21:30:00 +08:00
|
|
|
app.k8s.hty1024.com/version: v2.15.7
|
2024-08-07 00:53:00 +08:00
|
|
|
app.k8s.hty1024.com/resources: service
|
|
|
|
spec:
|
|
|
|
type: NodePort
|
|
|
|
ports:
|
|
|
|
- port: 3000
|
|
|
|
targetPort: 3000
|
|
|
|
nodePort: 30000
|
|
|
|
selector:
|
|
|
|
app.k8s.hty1024.com/env: prod
|
|
|
|
app.k8s.hty1024.com/type: app
|
|
|
|
app.k8s.hty1024.com/name: chatgpt-next-web
|
2024-11-11 21:30:00 +08:00
|
|
|
app.k8s.hty1024.com/version: v2.15.7
|
2024-08-07 00:53:00 +08:00
|
|
|
app.k8s.hty1024.com/resources: pod
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
# 创建 Deployment
|
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
name: hty1024-app-chatgpt-next-web-deployment
|
|
|
|
namespace: hty1024-app
|
|
|
|
labels:
|
|
|
|
app.k8s.hty1024.com/env: prod
|
|
|
|
app.k8s.hty1024.com/type: app
|
|
|
|
app.k8s.hty1024.com/name: chatgpt-next-web
|
2024-11-11 21:30:00 +08:00
|
|
|
app.k8s.hty1024.com/version: v2.15.7
|
2024-08-07 00:53:00 +08:00
|
|
|
app.k8s.hty1024.com/resources: deployment
|
|
|
|
spec:
|
|
|
|
replicas: 1
|
|
|
|
minReadySeconds: 30
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app.k8s.hty1024.com/env: prod
|
|
|
|
app.k8s.hty1024.com/type: app
|
|
|
|
app.k8s.hty1024.com/name: chatgpt-next-web
|
2024-11-11 21:30:00 +08:00
|
|
|
app.k8s.hty1024.com/version: v2.15.7
|
2024-08-07 00:53:00 +08:00
|
|
|
app.k8s.hty1024.com/resources: pod
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app.k8s.hty1024.com/env: prod
|
|
|
|
app.k8s.hty1024.com/type: app
|
|
|
|
app.k8s.hty1024.com/name: chatgpt-next-web
|
2024-11-11 21:30:00 +08:00
|
|
|
app.k8s.hty1024.com/version: v2.15.7
|
2024-08-07 00:53:00 +08:00
|
|
|
app.k8s.hty1024.com/resources: pod
|
|
|
|
spec:
|
|
|
|
terminationGracePeriodSeconds: 60
|
|
|
|
volumes:
|
|
|
|
- name: localtime
|
|
|
|
hostPath:
|
|
|
|
path: /etc/localtime
|
|
|
|
- name: shanghai
|
|
|
|
hostPath:
|
|
|
|
path: /usr/share/zoneinfo/Asia/Shanghai
|
|
|
|
containers:
|
|
|
|
- name: chatgpt-next-web
|
2024-11-11 21:30:00 +08:00
|
|
|
image: yidadaa/chatgpt-next-web:v2.15.7
|
2024-08-07 00:53:00 +08:00
|
|
|
ports:
|
|
|
|
- name: tcp
|
|
|
|
containerPort: 3000
|
|
|
|
volumeMounts:
|
|
|
|
- name: shanghai
|
|
|
|
mountPath: /etc/localtime
|
|
|
|
readOnly: true
|
|
|
|
env:
|
|
|
|
- name: OPENAI_API_KEY
|
|
|
|
value: "123456"
|
|
|
|
- name: GOOGLE_API_KEY
|
|
|
|
value: "123456"
|
|
|
|
- name: CODE
|
|
|
|
value: "123456"
|
|
|
|
nodeSelector:
|
|
|
|
node.k8s.hty1024.com/type: app
|
|
|
|
|