完成Gunicorn启动服务器的指南文档和快速启动停止脚本

This commit is contained in:
rjb
2025-08-24 23:40:44 +08:00
parent fb160a7a31
commit 09065f2ce7
11 changed files with 731 additions and 0 deletions

View File

@@ -0,0 +1,71 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: flask-prompt-master
labels:
app: flask-prompt-master
spec:
replicas: 2
selector:
matchLabels:
app: flask-prompt-master
template:
metadata:
labels:
app: flask-prompt-master
spec:
containers:
- name: app
image: flask-prompt-master:latest
ports:
- containerPort: 5000
env:
- name: FLASK_ENV
value: "production"
- name: SECRET_KEY
value: "your-secret-key-here"
resources:
requests:
memory: "256Mi"
cpu: "250m"
limits:
memory: "512Mi"
cpu: "500m"
livenessProbe:
httpGet:
path: /
port: 5000
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
httpGet:
path: /
port: 5000
initialDelaySeconds: 5
periodSeconds: 5
---
apiVersion: v1
kind: Service
metadata:
name: flask-prompt-master-service
spec:
selector:
app: flask-prompt-master
ports:
- protocol: TCP
port: 80
targetPort: 5000
type: NodePort
---
apiVersion: v1
kind: Service
metadata:
name: flask-prompt-master-loadbalancer
spec:
selector:
app: flask-prompt-master
ports:
- protocol: TCP
port: 5002
targetPort: 5000
type: LoadBalancer