完成Gunicorn启动服务器的指南文档和快速启动停止脚本
This commit is contained in:
71
k8s/simple-deployment.yaml
Normal file
71
k8s/simple-deployment.yaml
Normal 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
|
||||
Reference in New Issue
Block a user