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:
ArgoCD Setup
2026-03-14 04:42:07 -03:00
parent 46ec271788
commit 19d97159ce
8 changed files with 224 additions and 15 deletions

View File

@@ -491,12 +491,42 @@ log_info "Criando namespace cluster-autoscaler..."
kubectl create namespace cluster-autoscaler --dry-run=client -o yaml | kubectl apply -f -
kubectl label namespace cluster-autoscaler pod-security.kubernetes.io/enforce=privileged --overwrite
# Gerar cluster-config JSON (imagem por arch + config por pool)
CLUSTER_CONFIG_JSON=$(cat <<CCEOF
{
"imagesForArch": {
"arm64": "$TALOS_IMAGE_ID"
},
"nodeConfigs": {
"worker-pool": {
"cloudInit": "$WORKER_CONFIG_BASE64"
},
"gitlab-pool": {
"cloudInit": "$WORKER_CONFIG_BASE64"
},
"build-pool": {
"cloudInit": "$WORKER_CONFIG_BASE64",
"taints": [
{
"key": "dedicated",
"value": "builds",
"effect": "NoSchedule"
}
]
}
}
}
CCEOF
)
CLUSTER_CONFIG_BASE64=$(echo "$CLUSTER_CONFIG_JSON" | base64 | tr -d '\n')
# Criar secret
log_info "Criando secret do autoscaler..."
kubectl create secret generic hcloud-autoscaler \
--namespace cluster-autoscaler \
--from-literal=token="$HCLOUD_TOKEN" \
--from-literal=cloud-init="$WORKER_CONFIG_BASE64" \
--from-literal=cluster-config="$CLUSTER_CONFIG_BASE64" \
--dry-run=client -o yaml | kubectl apply -f -
log_success "Secret criado"