Merge branch 'dev' of https://github.com/rede5/gohorsejobs into dev
This commit is contained in:
commit
cc97ecbf3c
3 changed files with 48 additions and 5 deletions
|
|
@ -21,6 +21,7 @@ steps:
|
|||
registry: in.gohorsejobs.com
|
||||
repo: in.gohorsejobs.com/gohorsejobsdev/gohorsejobs-backend
|
||||
tags: [ latest, "${DRONE_COMMIT_SHA:0:8}" ]
|
||||
mtu: 1200
|
||||
context: backend
|
||||
dockerfile: backend/Dockerfile
|
||||
purge: true
|
||||
|
|
@ -34,7 +35,7 @@ steps:
|
|||
registry: in.gohorsejobs.com
|
||||
repo: in.gohorsejobs.com/gohorsejobs-backoffice-dev/backoffice
|
||||
tags: [ latest, "${DRONE_COMMIT_SHA:0:8}" ]
|
||||
mtu: 1300
|
||||
mtu: 1200
|
||||
custom_config:
|
||||
max-concurrent-uploads: 1
|
||||
context: backoffice
|
||||
|
|
@ -64,11 +65,13 @@ steps:
|
|||
PASSWORD_PEPPER: { from_secret: PASSWORD_PEPPER }
|
||||
NEXT_PUBLIC_API_URL: { from_secret: NEXT_PUBLIC_API_URL }
|
||||
NEXT_PUBLIC_BACKOFFICE_URL: { from_secret: NEXT_PUBLIC_BACKOFFICE_URL }
|
||||
MTU: { from_secret: MTU }
|
||||
|
||||
commands:
|
||||
# 1. Gera o arquivo .env garantindo que contenha as variáveis necessárias (incluindo as _DEV)
|
||||
- touch .env.k8s
|
||||
# O filtro abaixo agora captura tanto prefixos globais quanto o sufixo _DEV
|
||||
- env | grep -E '(AWS_|DB_|^ENV\b|CORS_|JWT_|MAX_|PORT|S3_|UPLOAD_|STRIPE_|WEBHOOK_|DATABASE_|CLOUDFLARE_|CPANEL_|HARBOR_|COOKIE_)' > .env.k8s
|
||||
- env | grep -E '(MTU|AWS_|DB_|^ENV\b|CORS_|JWT_|MAX_|PORT|S3_|UPLOAD_|STRIPE_|WEBHOOK_|DATABASE_|CLOUDFLARE_|CPANEL_|HARBOR_|COOKIE_)' > .env.k8s
|
||||
|
||||
# 2. Atualiza o secret de variáveis de ambiente no namespace de destino
|
||||
- kubectl -n gohorsejobsdev delete secret backend-secrets --ignore-not-found
|
||||
|
|
|
|||
|
|
@ -16,6 +16,20 @@ spec:
|
|||
spec:
|
||||
imagePullSecrets:
|
||||
- name: harbor-registry
|
||||
# --- INÍCIO DA CORREÇÃO DE REDE ---
|
||||
initContainers:
|
||||
- name: set-mtu
|
||||
image: busybox
|
||||
command: ['sh', '-c', 'ifconfig eth0 mtu $(MTU_VALUE)']
|
||||
env:
|
||||
- name: MTU_VALUE
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: backend-secrets
|
||||
key: MTU
|
||||
securityContext:
|
||||
privileged: true
|
||||
# --- FIM DA CORREÇÃO DE REDE ---
|
||||
containers:
|
||||
- name: backend
|
||||
image: in.gohorsejobs.com/gohorsejobsdev/gohorsejobs-backend:latest
|
||||
|
|
@ -25,6 +39,13 @@ spec:
|
|||
envFrom:
|
||||
- secretRef:
|
||||
name: backend-secrets
|
||||
# Adicionando a variável explicitamente também no container principal se precisar
|
||||
env:
|
||||
- name: MTU
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: backend-secrets
|
||||
key: MTU
|
||||
resources:
|
||||
requests:
|
||||
memory: "128Mi"
|
||||
|
|
|
|||
|
|
@ -16,15 +16,34 @@ spec:
|
|||
spec:
|
||||
imagePullSecrets:
|
||||
- name: harbor-registry
|
||||
# --- AJUSTE DE REDE (MTU) ---
|
||||
initContainers:
|
||||
- name: set-mtu
|
||||
image: busybox
|
||||
command: ['sh', '-c', 'ifconfig eth0 mtu $(MTU_VALUE)']
|
||||
env:
|
||||
- name: MTU_VALUE
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: backend-secrets
|
||||
key: MTU
|
||||
securityContext:
|
||||
privileged: true
|
||||
# --- FIM DO AJUSTE ---
|
||||
containers:
|
||||
- name: backoffice
|
||||
image: in.gohorsejobs.com/gohorsejobs-backoffice-dev/backoffice:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 3001 # Ajustado para a porta correta do Backoffice
|
||||
- containerPort: 3001
|
||||
env:
|
||||
- name: NODE_TLS_REJECT_UNAUTHORIZED
|
||||
value: "0" # Resolve o problema de "self-signed certificate" no banco
|
||||
value: "0"
|
||||
- name: MTU # Passando a variável para o container principal também
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: backend-secrets
|
||||
key: MTU
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: backend-secrets
|
||||
|
|
@ -34,4 +53,4 @@ spec:
|
|||
cpu: "300m"
|
||||
limits:
|
||||
memory: "2Gi"
|
||||
cpu: "800m"
|
||||
cpu: "800m"
|
||||
|
|
|
|||
Loading…
Reference in a new issue