85 lines
1.8 KiB
YAML
85 lines
1.8 KiB
YAML
![]() |
apiVersion: apps/v1
|
||
|
kind: Deployment
|
||
|
metadata:
|
||
|
name: api
|
||
|
namespace: general-bots
|
||
|
spec:
|
||
|
replicas: 3
|
||
|
selector:
|
||
|
matchLabels:
|
||
|
app: api
|
||
|
template:
|
||
|
metadata:
|
||
|
labels:
|
||
|
app: api
|
||
|
spec:
|
||
|
containers:
|
||
|
- name: api
|
||
|
image: generalbotsproject/api:latest
|
||
|
ports:
|
||
|
- containerPort: 8080
|
||
|
env:
|
||
|
- name: DATABASE_URL
|
||
|
valueFrom:
|
||
|
secretKeyRef:
|
||
|
name: postgres-creds
|
||
|
key: url
|
||
|
- name: REDIS_URL
|
||
|
value: redis://redis:6379
|
||
|
- name: KAFKA_BROKERS
|
||
|
value: kafka:9092
|
||
|
- name: RABBITMQ_URL
|
||
|
value: amqp://rabbitmq:5672
|
||
|
resources:
|
||
|
requests:
|
||
|
memory: "512Mi"
|
||
|
cpu: "500m"
|
||
|
limits:
|
||
|
memory: "1Gi"
|
||
|
cpu: "1000m"
|
||
|
readinessProbe:
|
||
|
httpGet:
|
||
|
path: /health
|
||
|
port: 8080
|
||
|
initialDelaySeconds: 5
|
||
|
periodSeconds: 10
|
||
|
livenessProbe:
|
||
|
httpGet:
|
||
|
path: /health
|
||
|
port: 8080
|
||
|
initialDelaySeconds: 15
|
||
|
periodSeconds: 20
|
||
|
---
|
||
|
apiVersion: v1
|
||
|
kind: Service
|
||
|
metadata:
|
||
|
name: api
|
||
|
namespace: general-bots
|
||
|
spec:
|
||
|
selector:
|
||
|
app: api
|
||
|
ports:
|
||
|
- port: 8080
|
||
|
---
|
||
|
apiVersion: networking.k8s.io/v1
|
||
|
kind: Ingress
|
||
|
metadata:
|
||
|
name: api
|
||
|
namespace: general-bots
|
||
|
annotations:
|
||
|
nginx.ingress.kubernetes.io/cors-allow-methods: "GET,POST,PUT,DELETE,OPTIONS"
|
||
|
nginx.ingress.kubernetes.io/cors-allow-origin: "*"
|
||
|
nginx.ingress.kubernetes.io/enable-cors: "true"
|
||
|
spec:
|
||
|
rules:
|
||
|
- host: api.general-bots.io
|
||
|
http:
|
||
|
paths:
|
||
|
- path: /
|
||
|
pathType: Prefix
|
||
|
backend:
|
||
|
service:
|
||
|
name: api
|
||
|
port:
|
||
|
number: 8080
|