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:
+7
-1
@@ -42,7 +42,13 @@ fi
|
||||
|
||||
# Remover namespace argocd
|
||||
log_info "Removendo namespace argocd..."
|
||||
kubectl delete namespace argocd --timeout=60s 2>/dev/null || true
|
||||
kubectl delete namespace argocd --timeout=120s 2>/dev/null || {
|
||||
log_warn "Namespace preso 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
|
||||
}
|
||||
|
||||
# Limpar secrets residuais
|
||||
log_info "Limpando secrets residuais..."
|
||||
|
||||
+11
-1
@@ -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..."
|
||||
|
||||
Reference in New Issue
Block a user