wbuchwalter / Kubernetes-acs-engine-autoscaler

[Deprecated] Node-level autoscaler for Kubernetes clusters created with acs-engine.
Other
71 stars 22 forks source link

KeyError: 'Standard_F4s_v2' #87

Open bailantaotao opened 6 years ago

bailantaotao commented 6 years ago

Hi,

I have created multiple agentpools with different vm_size and got errors after autoscaler installed. The flag of ignorepools has no effect, error still exists.

The error logs can be follows:

➜  .kube k logs autoscaler-acs-engine-autoscaler-3941933864-sgqvx
2018-03-18 09:53:40,675 - autoscaler.cluster - DEBUG - Using kube service account
2018-03-18 09:53:40,676 - autoscaler.cluster - INFO - ++++ Running Scaling Loop ++++++
2018-03-18 09:53:40,676 - autoscaler.cluster - INFO - Debug mode is on
Traceback (most recent call last):
  File "main.py", line 111, in <module>
    main()
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "main.py", line 100, in main
    scaled = cluster.loop(debug)
  File "/app/autoscaler/cluster.py", line 122, in loop
    return self.loop_logic()
  File "/app/autoscaler/cluster.py", line 142, in loop_logic
    all_nodes = list(filter(utils.is_agent, map(self.create_kube_node, pykube_nodes)))
  File "/app/autoscaler/cluster.py", line 132, in create_kube_node
    kube_node.capacity = capacity.get_capacity_for_instance_type(kube_node.instance_type)
  File "/app/autoscaler/capacity.py", line 22, in get_capacity_for_instance_type
    return RESOURCE_SPEC[instance_type]
KeyError: 'Standard_F4s_v2'

When there is only one vm_size in agentpools, the autoscaler was back to normal.

Other useful informations:

My vm_size:

  memory_pool = {
    name            = "memory"
    count           = 4
    vnet_subnet_id  = "${local.vnet_subnet_id}"
    vm_size         = "Standard_DS2_v2"
    os_disk_size_gb = 512
    storage_profile = "ManagedDisks"
  }

  memory_plus_pool = {
    name            = "memoryplus"
    count           = 1
    vnet_subnet_id  = "${local.vnet_subnet_id}"
    vm_size         = "Standard_D8s_v3"
    os_disk_size_gb = 512
    storage_profile = "ManagedDisks"
  }

  compute_pool = {
    name            = "compute"
    count           = 1
    vnet_subnet_id  = "${local.vnet_subnet_id}"
    vm_size         = "Standard_F4s_v2"
    os_disk_size_gb = 512
    storage_profile = "ManagedDisks"
  }

  storage_pool = {
    name              = "storage"
    count             = 1
    vnet_subnet_id    = "${local.vnet_subnet_id}"
    vm_size           = "Standard_L4s"
    os_disk_size_gb   = 512
    storage_profile   = "ManagedDisks"
    data_disk_size_gb = "[1023]"
  }