fix: corrigir setup.sh de múltiplas aulas
- aula-08: adicionar key cluster-config no secret do autoscaler - aula-09,10,11,12,14,15: adicionar pausa DNS antes do helm install (Let's Encrypt precisa do DNS configurado para emitir certificado) - aula-09,10,11: corrigir anotação cert-manager.io/cluster-issuer (--set do Helm interpreta pontos como separadores de nested keys) - aula-10: corrigir load_config com set -e (exit silencioso) - aula-10: adicionar teste rápido do registry no README
This commit is contained in:
@@ -337,6 +337,23 @@ if [[ "$USE_LETSENCRYPT" == "true" ]]; then
|
||||
echo ""
|
||||
fi
|
||||
|
||||
# =============================================================================
|
||||
# 2.5. PAUSA PARA CONFIGURAÇÃO DE DNS
|
||||
# =============================================================================
|
||||
|
||||
show_dns_instructions
|
||||
|
||||
echo ""
|
||||
echo -e "${YELLOW}⚠ Configure o DNS agora antes de continuar.${NC}"
|
||||
if [[ "$USE_LETSENCRYPT" == "true" ]]; then
|
||||
echo -e "${YELLOW} O Let's Encrypt precisa do DNS configurado para emitir o certificado.${NC}"
|
||||
fi
|
||||
echo ""
|
||||
echo -n "Pressione ENTER quando o DNS estiver configurado..."
|
||||
read -r
|
||||
|
||||
echo ""
|
||||
|
||||
# =============================================================================
|
||||
# 3. CRIAR NAMESPACE E APLICAR SECRETS
|
||||
# =============================================================================
|
||||
@@ -380,11 +397,18 @@ else
|
||||
HELM_ARGS="$HELM_ARGS --set webhook.url=http://${N8N_HOST}"
|
||||
fi
|
||||
|
||||
# Configurar TLS
|
||||
# Configurar TLS - gerar values overlay para anotações com pontos
|
||||
TEMP_TLS_VALUES=$(mktemp)
|
||||
if [[ "$USE_LETSENCRYPT" == "true" ]]; then
|
||||
HELM_ARGS="$HELM_ARGS --set ingress.annotations.cert-manager\\.io/cluster-issuer=letsencrypt"
|
||||
HELM_ARGS="$HELM_ARGS --set ingress.tls[0].hosts[0]=${N8N_HOST}"
|
||||
HELM_ARGS="$HELM_ARGS --set ingress.tls[0].secretName=n8n-tls"
|
||||
cat > "$TEMP_TLS_VALUES" <<EOF
|
||||
ingress:
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: letsencrypt
|
||||
EOF
|
||||
else
|
||||
echo "{}" > "$TEMP_TLS_VALUES"
|
||||
fi
|
||||
|
||||
# Configurar N8N_SECURE_COOKIE
|
||||
@@ -400,6 +424,7 @@ if helm status n8n -n n8n &> /dev/null; then
|
||||
eval helm upgrade n8n community-charts/n8n \
|
||||
--namespace n8n \
|
||||
--values "$SCRIPT_DIR/custom-values.yaml" \
|
||||
-f "$TEMP_TLS_VALUES" \
|
||||
$HELM_ARGS \
|
||||
--wait \
|
||||
--timeout 10m
|
||||
@@ -409,12 +434,15 @@ else
|
||||
eval helm install n8n community-charts/n8n \
|
||||
--namespace n8n \
|
||||
--values "$SCRIPT_DIR/custom-values.yaml" \
|
||||
-f "$TEMP_TLS_VALUES" \
|
||||
$HELM_ARGS \
|
||||
--wait \
|
||||
--timeout 10m
|
||||
log_success "n8n instalado com sucesso!"
|
||||
fi
|
||||
|
||||
rm -f "$TEMP_TLS_VALUES"
|
||||
|
||||
echo ""
|
||||
|
||||
# =============================================================================
|
||||
@@ -480,9 +508,6 @@ echo " Hostname: ${N8N_HOST}"
|
||||
echo " CloudFlare: ${USE_CLOUDFLARE}"
|
||||
echo " Let's Encrypt: ${USE_LETSENCRYPT}"
|
||||
|
||||
# Mostrar instruções de DNS
|
||||
show_dns_instructions
|
||||
|
||||
echo ""
|
||||
echo "Comandos úteis:"
|
||||
echo " # Ver todos os pods"
|
||||
|
||||
Reference in New Issue
Block a user