Files
Airtep/gig-poc/infrastructure/k8s/api.yaml
2026-04-01 14:19:25 +08:00

91 lines
2.0 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: gig-poc-api
namespace: gig-poc
spec:
replicas: 3
selector:
matchLabels:
app: gig-poc-api
template:
metadata:
labels:
app: gig-poc-api
spec:
containers:
- name: api
image: gig-poc-api:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8000
env:
- name: APP_ENV
value: production
- name: CACHE_BACKEND
value: redis
- name: REDIS_URL
value: redis://gig-poc-redis:6379/0
- name: INGEST_ASYNC_ENABLED
value: "true"
- name: MATCH_ASYNC_ENABLED
value: "true"
- name: MATCH_CACHE_ENABLED
value: "true"
- name: QUERY_CACHE_ENABLED
value: "true"
- name: APP_RATE_LIMIT_PER_MINUTE
value: "3000"
resources:
requests:
cpu: "500m"
memory: "512Mi"
limits:
cpu: "2"
memory: "2Gi"
readinessProbe:
httpGet:
path: /health
port: 8000
initialDelaySeconds: 10
periodSeconds: 10
livenessProbe:
httpGet:
path: /health
port: 8000
initialDelaySeconds: 30
periodSeconds: 15
---
apiVersion: v1
kind: Service
metadata:
name: gig-poc-api
namespace: gig-poc
spec:
selector:
app: gig-poc-api
ports:
- name: http
port: 8000
targetPort: 8000
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: gig-poc-api-hpa
namespace: gig-poc
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: gig-poc-api
minReplicas: 3
maxReplicas: 20
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70