Terraform-provider-azurerm: azurerm_container_service.agent_pool_profile is limited to 1

Created on 13 Jun 2017  ·  3Comments  ·  Source: terraform-providers/terraform-provider-azurerm

_This issue was originally opened by @privatwolke as hashicorp/terraform#12652. It was migrated here as part of the provider split. The original body of the issue is below._


Terraform Version

Terraform v0.8.8

Affected Resource(s)

  • azurerm_container_service

Terraform Configuration Files

resource "azurerm_container_service" "kubernetes" {
  name                   = "myacsname"
  location               = "West Europe"
  resource_group_name    = "someresourcegroup"
  orchestration_platform = "Kubernetes"

  master_profile {
    count      = 1
    dns_prefix = "xxxmaster"
  }

  linux_profile {
    admin_username = "xxxx"

    ssh_key {
      key_data = "${file("authorized_keys")}"
    }
  }

  agent_pool_profile {
    name       = "default"
    count      = 2
    dns_prefix = "xxxagent"
    vm_size    = "Standard_F1s"
  }

  agent_pool_profile {
    name       = "default2"
    count      = 2
    dns_prefix = "xxxagent2"
    vm_size    = "Standard_A0"
  }

  service_principal {
    client_id     = "xxx"
    client_secret = "xxx"
  }

  diagnostics_profile {
    enabled = false
  }
}

Output

azurerm_container_service.kubernetes: agent_pool_profile: attribute supports 1 item maximum, config has 2 declared

Expected Behavior

Multiple agent pool profiles should be supported.

Actual Behavior

Multiple agent pool profiles don't seem to be supported.

Steps to Reproduce

  1. terraform plan

References

bug

Most helpful comment

@tombuildsstuff Perhaps this could be re-looked? I believe the Azure apis now support this feature, for example, acs-engine has an example with multiple node pools here and this issue seems to confirm that.

Having support for this feature in terraform would make running hybrid K8s clusters on ASK much simpler.

All 3 comments

Hey @privatwolke

Thanks for opening this issue :)

I've taken a look into this issue - and whilst the Azure API is configured to support multiple agent pools, the Azure Container Service itself doesn't yet support this functionality, and thus the API returns an error when trying to specify multiple agent pools:

  • azurerm_container_service.test: containerservice.ContainerServicesClient#CreateOrUpdate: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="agentPoolProfile count was: 2. Only one agentPoolProfile is supported at this time."

As such - until this is supported by the Azure Container Service limiting to a single agent pool seems preferable over returning the API error shown above (given we can fail at plan time, rather than during the apply). Given this is a feature request for Azure, I'm going to close this issue for the moment - however once this is supported by ACS it's relatively quick to add support for multiple agent pools - and we'll take a look :)

Thanks!

@tombuildsstuff Perhaps this could be re-looked? I believe the Azure apis now support this feature, for example, acs-engine has an example with multiple node pools here and this issue seems to confirm that.

Having support for this feature in terraform would make running hybrid K8s clusters on ASK much simpler.

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

Was this page helpful?
0 / 5 - 0 ratings