72 lines
1.4 KiB
YAML
72 lines
1.4 KiB
YAML
|
|
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
|