130 lines
2.7 KiB
YAML
130 lines
2.7 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: flask-prompt-master
|
|
labels:
|
|
app: flask-prompt-master
|
|
spec:
|
|
replicas: 3
|
|
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: DATABASE_URL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: flask-secrets
|
|
key: database-url
|
|
- name: SECRET_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: flask-secrets
|
|
key: secret-key
|
|
- name: LLM_API_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: flask-secrets
|
|
key: llm-api-key
|
|
resources:
|
|
requests:
|
|
memory: "256Mi"
|
|
cpu: "250m"
|
|
limits:
|
|
memory: "512Mi"
|
|
cpu: "500m"
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: 5000
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: 5000
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 5
|
|
volumeMounts:
|
|
- name: logs
|
|
mountPath: /app/logs
|
|
- name: uploads
|
|
mountPath: /app/uploads
|
|
volumes:
|
|
- name: logs
|
|
persistentVolumeClaim:
|
|
claimName: logs-pvc
|
|
- name: uploads
|
|
persistentVolumeClaim:
|
|
claimName: uploads-pvc
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: flask-prompt-master-service
|
|
spec:
|
|
selector:
|
|
app: flask-prompt-master
|
|
ports:
|
|
- protocol: TCP
|
|
port: 80
|
|
targetPort: 5000
|
|
type: ClusterIP
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: Ingress
|
|
metadata:
|
|
name: flask-prompt-master-ingress
|
|
annotations:
|
|
nginx.ingress.kubernetes.io/rewrite-target: /
|
|
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
|
spec:
|
|
tls:
|
|
- hosts:
|
|
- flask-prompt-master.example.com
|
|
secretName: flask-prompt-master-tls
|
|
rules:
|
|
- host: flask-prompt-master.example.com
|
|
http:
|
|
paths:
|
|
- path: /
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: flask-prompt-master-service
|
|
port:
|
|
number: 80
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: logs-pvc
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: 10Gi
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: uploads-pvc
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: 5Gi
|