fix: corrigir tipos de servidor AMD (CPX→CX), autoscaler, stdin e cleanup

- Corrigir tipos Hetzner: CPX não existe, usar CX (Intel shared vCPU)
  - CX23 (2 vCPU, 4GB) equivalente ao CAX11
  - CX33 (4 vCPU, 8GB) equivalente ao CAX21
  - CX43 (8 vCPU, 16GB) equivalente ao CAX31
- Corrigir location no autoscaler para amd64 (nbg1→fsn1)
- Remover gitlab-pool do autoscaler (substituído pelo Gitea)
- Aumentar worker-pool max para 30
- Corrigir Floating IP e Load Balancer hardcoded em nbg1
- Corrigir stdin em read interativo: usar < /dev/tty e read -p
- Corrigir cleanup de namespace: lidar com Terminating e finalizers
- Corrigir CNPG: nome do deployment, secret e endpointURL duplo
- Aulas afetadas: 08, 09, 10, 11, 12, 14, 17
This commit is contained in:
ArgoCD Setup
2026-05-09 07:24:26 -03:00
parent 3d042a29ae
commit a0cf1e6cef
18 changed files with 153 additions and 92 deletions
+11 -1
View File
@@ -236,7 +236,17 @@ log_info "=== Instalando ArgoCD ==="
helm repo add argo https://argoproj.github.io/argo-helm 2>/dev/null || true
helm repo update
kubectl create namespace argocd 2>/dev/null || true
if kubectl get namespace argocd &>/dev/null; then
NS_PHASE=$(kubectl get namespace argocd -o jsonpath='{.status.phase}' 2>/dev/null)
if [[ "$NS_PHASE" == "Terminating" ]]; then
log_info "Namespace argocd em Terminating, forçando remoção..."
kubectl get namespace argocd -o json | \
python3 -c "import sys,json; d=json.load(sys.stdin); d['metadata'].pop('finalizers',None); json.dump(d,sys.stdout)" | \
kubectl replace --raw /api/v1/namespaces/argocd/finalize -f - 2>/dev/null || true
kubectl wait --for=delete namespace argocd --timeout=60s 2>/dev/null || sleep 5
fi
fi
kubectl create namespace argocd --dry-run=client -o yaml | kubectl apply -f -
if helm status argocd -n argocd &> /dev/null; then
log_warn "ArgoCD já instalado, fazendo upgrade..."