kube-hetzner / terraform-hcloud-kube-hetzner

Optimized and Maintenance-free Kubernetes on Hetzner Cloud in one command!
MIT License
2.41k stars 372 forks source link

[Bug]: "error during placement (resource_unavailable" #1539

Closed djwashburn closed 2 weeks ago

djwashburn commented 2 weeks ago

Description

I have been going through the readme/startup guide. I got everything to work up until terraform apply -auto-approve. Every time I run that, I get a long spew of error messages along these lines:

 ╷
 │ Error: error during placement (resource_unavailable, 1d1d17e504e28a4c)
 │
 │   with module.kube-hetzner.module.agents["2-0-storage"].hcloud_server.server,
 │   on .terraform\modules\kube-hetzner\modules\host\main.tf line 22, in resource "hcloud_server" "server":
 │   22: resource "hcloud_server" "server" {
 │
 ╵

Kube.tf file

locals {

  hcloud_token = "<my_token_here>"
}

module "kube-hetzner" {
  providers = {
    hcloud = hcloud
  }
  hcloud_token = var.hcloud_token != "" ? var.hcloud_token : local.hcloud_token

  source = "kube-hetzner/kube-hetzner/hcloud"

  control_plane_nodepools = [
    {
      name        = "control-plane-ash",
      server_type = "cx22",
      location    = "ash",
      labels      = [],
      taints      = [],
      count       = 1
    },
    {
      name        = "control-plane-ash-2",
      server_type = "cx22",
      location    = "ash",
      labels      = [],
      taints      = [],
      count       = 1
    },
    {
      name        = "control-plane-ash-3",
      server_type = "cx22",
      location    = "ash",
      labels      = [],
      taints      = [],
      count       = 1
    }
  ]

  agent_nodepools = [
    {
      name        = "agent-small",
      server_type = "cx22",
      location    = "ash",
      labels      = [],
      taints      = [],
      count       = 1
    },
    {
      name        = "agent-large",
      server_type = "cx32",
      location    = "ash",
      labels      = [],
      taints      = [],
      count       = 1
    },
    {
      name        = "storage",
      server_type = "cx32",
      location    = "ash",
      labels      = [
        "node.kubernetes.io/server-usage=storage"
      ],
      taints      = [],
      count       = 1
    },
    {
      name        = "egress",
      server_type = "cx22",
      location    = "ash",
      labels = [
        "node.kubernetes.io/role=egress"
      ],
      taints = [
        "node.kubernetes.io/role=egress:NoSchedule"
      ],
      floating_ip = true
      count = 1
    },
    {
      name        = "agent-arm-small",
      server_type = "cax11",
      location    = "ash",
      labels      = [],
      taints      = [],
      count       = 1
    },
    {
      name        = "agent-arm-small-2",
      server_type = "cax11",
      location    = "ash",
      labels      = [],
      taints      = [],
      nodes = {
        "1" : {
          location                  = "ash"
          labels = [
            "testing-labels=a1",
          ]
        },
        "20" : {
          labels = [
            "testing-labels=b1",
          ]
        }
      }
    },
  ]

  load_balancer_type     = "lb11"
  load_balancer_location = "ash"

  system_upgrade_use_drain = true

  dns_servers = [
    "1.1.1.1",
    "8.8.8.8",
    "2606:4700:4700::1111",
  ]
}

provider "hcloud" {
  token = var.hcloud_token != "" ? var.hcloud_token : local.hcloud_token
}

terraform {
  required_version = ">= 1.5.0"
  required_providers {
    hcloud = {
      source  = "hetznercloud/hcloud"
      version = ">= 1.43.0"
    }
  }
}

output "kubeconfig" {
  value     = module.kube-hetzner.kubeconfig
  sensitive = true
}

variable "hcloud_token" {
  sensitive = true
  default   = ""
}

Screenshots

No response

Platform

Windows

mysticaltech commented 2 weeks ago

@djwashburn ash is in the US, so make sure to specify the network_region accordingly.