I don't know. k8s is pretty complicated. How many small/medium apps need more than this nginx/Terraform/Docker example? This would be a lot more difficult to set up in k8s (pods, ingress, etc.)
Terraform:
resource "docker_container" "app" { count = 2
name = "app-${count.index}" hostname = "app-${count.index}" image = "app:${var.app_version}" restart = "always" env = [ ... ] ports { internal = parseint("${var.app_port}", 10) + count.index external = parseint("${var.app_port}", 10) + count.index } networks_advanced { name = "${docker_network.private_network.name}" aliases = ["app-${count.index}"] } depends_on = [ ... ]
Nginx:
http { ...
upstream app { server app-0:3000; server app-1:3001; } server { listen 80; root /usr/share/nginx/html; location ~* ^/api/ { rewrite ^/api/(.*) /$1 break; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_http_version 1.1; proxy_pass http://app; } } }
Is there some epidemic of developers setting up complex, multi-node Kubernetes clusters just to run a small web app ?
I don't know. k8s is pretty complicated. How many small/medium apps need more than this nginx/Terraform/Docker example? This would be a lot more difficult to set up in k8s (pods, ingress, etc.)
Terraform:
resource "docker_container" "app" { count = 2
}Nginx:
http { ...