Workshop completo: aulas 08-10 com Talos, n8n e GitLab na Hetzner

Aula 08 - Cluster Kubernetes HA:
- Setup interativo com OpenTofu para Talos na Hetzner
- CCM, CSI Driver, Cluster Autoscaler, Metrics Server
- NGINX Ingress com LoadBalancer (HTTP/HTTPS/SSH)

Aula 09 - n8n na Hetzner:
- Deploy via Helm com PostgreSQL e Redis
- Suporte multi-tenant com add-client.sh
- Integração com Hetzner CSI para volumes persistentes

Aula 10 - GitLab na Hetzner:
- Setup agnóstico: CloudFlare (trusted proxies) ou Let's Encrypt
- Anti-affinity para distribuir webservice/sidekiq em nós diferentes
- Container Registry e SSH via TCP passthrough
- Documentação do erro 422 e solução com trustedCIDRsForXForwardedFor

Melhorias gerais:
- READMEs atualizados com arquitetura e troubleshooting
- Scripts cleanup.sh para todas as aulas
- CLAUDE.md atualizado com contexto do projeto
This commit is contained in:
Allyson de Paula
2025-12-31 17:57:02 -03:00
parent 50dc74c1d8
commit 07b7ee62d3
35 changed files with 4665 additions and 311 deletions

View File

@@ -26,8 +26,13 @@ output "network_cidr" {
# Control Plane Information
output "control_plane_ip" {
description = "Public IP address of the control plane"
value = hcloud_floating_ip.control_plane.ip_address
description = "Public IP address of the control plane (LB or Floating IP)"
value = local.cluster_endpoint_ip
}
output "load_balancer_ip" {
description = "Public IP of the Load Balancer (if enabled)"
value = var.enable_loadbalancer ? hcloud_load_balancer.cluster[0].ipv4 : null
}
output "control_plane_private_ips" {
@@ -70,22 +75,23 @@ output "talosconfig_path" {
# API Endpoints
output "kubernetes_api_endpoint" {
description = "Kubernetes API server endpoint"
value = "https://${hcloud_floating_ip.control_plane.ip_address}:6443"
value = "https://${local.cluster_endpoint_ip}:6443"
}
output "talos_api_endpoint" {
description = "Talos API endpoint for management"
value = "https://${hcloud_floating_ip.control_plane.ip_address}:50000"
value = "https://${local.cluster_endpoint_ip}:50000"
}
# Cost Information
output "estimated_monthly_cost" {
description = "Estimated monthly cost for the infrastructure (EUR)"
description = "Estimated monthly cost for the infrastructure (USD)"
value = {
control_plane = 3 * 3.79 # 3x CAX11
worker = 1 * 3.79 # 1x CAX11
floating_ip = 3.00 # Floating IPv4
total = (4 * 3.79) + 3.00 # ~€18.16
control_plane = local.control_plane_count * 4.59
worker = 1 * 4.59
load_balancer = var.enable_loadbalancer ? 5.99 : 0
floating_ip = var.enable_loadbalancer ? 0 : 3.29
total = (local.control_plane_count + 1) * 4.59 + (var.enable_loadbalancer ? 5.99 : 3.29)
}
}
@@ -104,16 +110,15 @@ output "connection_instructions" {
2. Configure talosctl:
export TALOSCONFIG=${local_sensitive_file.talosconfig.filename}
talosctl --nodes ${hcloud_floating_ip.control_plane.ip_address} health
talosctl --nodes ${local.cluster_endpoint_ip} health
3. Access Kubernetes API:
${"https://${hcloud_floating_ip.control_plane.ip_address}:6443"}
https://${local.cluster_endpoint_ip}:6443
4. Nodes:
Control Plane: 3x CAX11 (ARM64)
Control Plane: ${local.control_plane_count}x CAX11 (ARM64)
Workers: 1x CAX11 (ARM64)
5. Total Monthly Cost: ~€18/month
${var.enable_loadbalancer ? "Load Balancer: LB11" : "Floating IP: IPv4"}
====================================
EOT