79 lines
1.9 KiB
YAML
79 lines
1.9 KiB
YAML
|
|
# ================================================================
|
||
|
|
# Kubernetes Deployment: infrastructure/kubernetes/base/forecasting-service.yaml
|
||
|
|
# ================================================================
|
||
|
|
apiVersion: apps/v1
|
||
|
|
kind: Deployment
|
||
|
|
metadata:
|
||
|
|
name: forecasting-service
|
||
|
|
labels:
|
||
|
|
app: forecasting-service
|
||
|
|
spec:
|
||
|
|
replicas: 2
|
||
|
|
selector:
|
||
|
|
matchLabels:
|
||
|
|
app: forecasting-service
|
||
|
|
template:
|
||
|
|
metadata:
|
||
|
|
labels:
|
||
|
|
app: forecasting-service
|
||
|
|
spec:
|
||
|
|
containers:
|
||
|
|
- name: forecasting-service
|
||
|
|
image: bakery-forecasting/forecasting-service:latest
|
||
|
|
ports:
|
||
|
|
- containerPort: 8000
|
||
|
|
env:
|
||
|
|
- name: DATABASE_URL
|
||
|
|
valueFrom:
|
||
|
|
secretKeyRef:
|
||
|
|
name: forecasting-db-secret
|
||
|
|
key: database-url
|
||
|
|
- name: RABBITMQ_URL
|
||
|
|
valueFrom:
|
||
|
|
secretKeyRef:
|
||
|
|
name: rabbitmq-secret
|
||
|
|
key: url
|
||
|
|
- name: REDIS_URL
|
||
|
|
valueFrom:
|
||
|
|
secretKeyRef:
|
||
|
|
name: redis-secret
|
||
|
|
key: url
|
||
|
|
- name: TRAINING_SERVICE_URL
|
||
|
|
value: "http://training-service:8000"
|
||
|
|
- name: DATA_SERVICE_URL
|
||
|
|
value: "http://data-service:8000"
|
||
|
|
resources:
|
||
|
|
requests:
|
||
|
|
memory: "512Mi"
|
||
|
|
cpu: "250m"
|
||
|
|
limits:
|
||
|
|
memory: "1Gi"
|
||
|
|
cpu: "500m"
|
||
|
|
livenessProbe:
|
||
|
|
httpGet:
|
||
|
|
path: /health
|
||
|
|
port: 8000
|
||
|
|
initialDelaySeconds: 30
|
||
|
|
periodSeconds: 10
|
||
|
|
readinessProbe:
|
||
|
|
httpGet:
|
||
|
|
path: /health
|
||
|
|
port: 8000
|
||
|
|
initialDelaySeconds: 5
|
||
|
|
periodSeconds: 5
|
||
|
|
---
|
||
|
|
apiVersion: v1
|
||
|
|
kind: Service
|
||
|
|
metadata:
|
||
|
|
name: forecasting-service
|
||
|
|
labels:
|
||
|
|
app: forecasting-service
|
||
|
|
spec:
|
||
|
|
selector:
|
||
|
|
app: forecasting-service
|
||
|
|
ports:
|
||
|
|
- port: 8000
|
||
|
|
targetPort: 8000
|
||
|
|
type: ClusterIP
|
||
|
|
|