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
|
registry: in.gohorsejobs.com
|
||||||
repo: in.gohorsejobs.com/gohorsejobsdev/gohorsejobs-backend
|
repo: in.gohorsejobs.com/gohorsejobsdev/gohorsejobs-backend
|
||||||
tags: [ latest, "${DRONE_COMMIT_SHA:0:8}" ]
|
tags: [ latest, "${DRONE_COMMIT_SHA:0:8}" ]
|
||||||
|
mtu: 1200
|
||||||
context: backend
|
context: backend
|
||||||
dockerfile: backend/Dockerfile
|
dockerfile: backend/Dockerfile
|
||||||
purge: true
|
purge: true
|
||||||
|
|
@ -34,7 +35,7 @@ steps:
|
||||||
registry: in.gohorsejobs.com
|
registry: in.gohorsejobs.com
|
||||||
repo: in.gohorsejobs.com/gohorsejobs-backoffice-dev/backoffice
|
repo: in.gohorsejobs.com/gohorsejobs-backoffice-dev/backoffice
|
||||||
tags: [ latest, "${DRONE_COMMIT_SHA:0:8}" ]
|
tags: [ latest, "${DRONE_COMMIT_SHA:0:8}" ]
|
||||||
mtu: 1300
|
mtu: 1200
|
||||||
custom_config:
|
custom_config:
|
||||||
max-concurrent-uploads: 1
|
max-concurrent-uploads: 1
|
||||||
context: backoffice
|
context: backoffice
|
||||||
|
|
@ -64,11 +65,13 @@ steps:
|
||||||
PASSWORD_PEPPER: { from_secret: PASSWORD_PEPPER }
|
PASSWORD_PEPPER: { from_secret: PASSWORD_PEPPER }
|
||||||
NEXT_PUBLIC_API_URL: { from_secret: NEXT_PUBLIC_API_URL }
|
NEXT_PUBLIC_API_URL: { from_secret: NEXT_PUBLIC_API_URL }
|
||||||
NEXT_PUBLIC_BACKOFFICE_URL: { from_secret: NEXT_PUBLIC_BACKOFFICE_URL }
|
NEXT_PUBLIC_BACKOFFICE_URL: { from_secret: NEXT_PUBLIC_BACKOFFICE_URL }
|
||||||
|
MTU: { from_secret: MTU }
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
# 1. Gera o arquivo .env garantindo que contenha as variáveis necessárias (incluindo as _DEV)
|
# 1. Gera o arquivo .env garantindo que contenha as variáveis necessárias (incluindo as _DEV)
|
||||||
- touch .env.k8s
|
- touch .env.k8s
|
||||||
# O filtro abaixo agora captura tanto prefixos globais quanto o sufixo _DEV
|
# 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
|
# 2. Atualiza o secret de variáveis de ambiente no namespace de destino
|
||||||
- kubectl -n gohorsejobsdev delete secret backend-secrets --ignore-not-found
|
- kubectl -n gohorsejobsdev delete secret backend-secrets --ignore-not-found
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,20 @@ spec:
|
||||||
spec:
|
spec:
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
- name: harbor-registry
|
- 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:
|
containers:
|
||||||
- name: backend
|
- name: backend
|
||||||
image: in.gohorsejobs.com/gohorsejobsdev/gohorsejobs-backend:latest
|
image: in.gohorsejobs.com/gohorsejobsdev/gohorsejobs-backend:latest
|
||||||
|
|
@ -25,6 +39,13 @@ spec:
|
||||||
envFrom:
|
envFrom:
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: backend-secrets
|
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:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
memory: "128Mi"
|
memory: "128Mi"
|
||||||
|
|
|
||||||
|
|
@ -16,15 +16,34 @@ spec:
|
||||||
spec:
|
spec:
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
- name: harbor-registry
|
- 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:
|
containers:
|
||||||
- name: backoffice
|
- name: backoffice
|
||||||
image: in.gohorsejobs.com/gohorsejobs-backoffice-dev/backoffice:latest
|
image: in.gohorsejobs.com/gohorsejobs-backoffice-dev/backoffice:latest
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 3001 # Ajustado para a porta correta do Backoffice
|
- containerPort: 3001
|
||||||
env:
|
env:
|
||||||
- name: NODE_TLS_REJECT_UNAUTHORIZED
|
- 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:
|
envFrom:
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: backend-secrets
|
name: backend-secrets
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue