63 lines
No EOL
1.7 KiB
YAML
63 lines
No EOL
1.7 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: gohorse-backend-dev
|
|
namespace: gohorsejobsdev
|
|
spec:
|
|
replicas: 1
|
|
# ESTRATÉGIA: Mata o pod antigo antes de iniciar o novo (ideal para pouca RAM)
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
app: gohorse-backend-dev
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: gohorse-backend-dev
|
|
env: development
|
|
spec:
|
|
# Tempo para o pod antigo desligar (padrão é 30s, reduzimos para 10s)
|
|
terminationGracePeriodSeconds: 10
|
|
imagePullSecrets:
|
|
- name: forgejo-registry-secret
|
|
initContainers:
|
|
- name: set-mtu
|
|
image: busybox:latest
|
|
command: ['sh', '-c', 'ifconfig eth0 mtu ${MTU_VALUE} || true']
|
|
env:
|
|
- name: MTU_VALUE
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: backend-secrets
|
|
key: MTU
|
|
securityContext:
|
|
privileged: true
|
|
containers:
|
|
- name: backend
|
|
image: pipe.gohorsejobs.com/bohessefm/gohorsejobs:latest
|
|
imagePullPolicy: Always
|
|
ports:
|
|
- containerPort: 8521
|
|
envFrom:
|
|
- secretRef:
|
|
name: backend-secrets
|
|
resources:
|
|
requests:
|
|
memory: "256Mi"
|
|
cpu: "100m"
|
|
limits:
|
|
memory: "1024Mi"
|
|
cpu: "1000m"
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: 8521
|
|
initialDelaySeconds: 45 # Aumentado para evitar restart loop inicial
|
|
periodSeconds: 20
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: 8521
|
|
initialDelaySeconds: 20
|
|
periodSeconds: 10 |