mirror of
https://github.com/wahyd4/home-docker.git
synced 2026-08-08 20:15:03 +10:00
95 lines
2.1 KiB
YAML
95 lines
2.1 KiB
YAML
# source https://github.com/GaiZhenbiao/ChuanhuChatGPT
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
namespace: home-apps
|
|
name: ch-chatgpt-pvc
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
storageClassName: nfs-client
|
|
resources:
|
|
requests:
|
|
storage: 5Gi
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: ch-chatgpt
|
|
namespace: home-apps
|
|
spec:
|
|
ports:
|
|
- port: 7860
|
|
targetPort: 7860
|
|
selector:
|
|
app: ch-chatgpt
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: ch-chatgpt
|
|
spec:
|
|
revisionHistoryLimit: 2
|
|
selector:
|
|
matchLabels:
|
|
app: ch-chatgpt
|
|
replicas: 1
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: ch-chatgpt
|
|
spec:
|
|
volumes:
|
|
- name: config
|
|
persistentVolumeClaim:
|
|
claimName: ch-chatgpt-pvc
|
|
containers:
|
|
- name: ch-chatgpt
|
|
image: tuchuanhuhuhu/chuanhuchatgpt:latest
|
|
imagePullPolicy: Always
|
|
ports:
|
|
- containerPort: 7860
|
|
env:
|
|
- name: my_api_key
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: chatgpt-api-key
|
|
key: api-key
|
|
resources:
|
|
requests:
|
|
cpu: 200m
|
|
memory: 256Mi
|
|
limits:
|
|
cpu: 500m
|
|
memory: 1024Mi
|
|
volumeMounts:
|
|
- name: config
|
|
mountPath: /app/history
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: Ingress
|
|
metadata:
|
|
name: ch-chatgpt-ingress
|
|
annotations:
|
|
kubernetes.io/ingress.class: "nginx"
|
|
kubernetes.io/tls-acme: "true"
|
|
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
|
nginx.ingress.kubernetes.io/auth-url: "https://id.junv.me/oauth2/auth"
|
|
nginx.ingress.kubernetes.io/auth-signin: "https://id.junv.me/oauth2/start?rd=https%3A%2F%2F$host$request_uri"
|
|
spec:
|
|
tls:
|
|
- hosts:
|
|
- chatgpt.junv.me
|
|
secretName: chatgpt-tls
|
|
rules:
|
|
- host: chatgpt.junv.me
|
|
http:
|
|
paths:
|
|
- backend:
|
|
service:
|
|
name: ch-chatgpt
|
|
port:
|
|
number: 7860
|
|
path: /
|
|
pathType: Prefix
|