Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure Kubernetes Clusters: load_balancer_sku breaks cluster definition from 1.31 --> 1.32 #3952

Closed
brondum opened this issue Jul 29, 2019 · 6 comments

Comments

@brondum
Copy link

brondum commented Jul 29, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Terraform v0.12.3
AzureRM: 1.32

Affected Resource(s)

  • azurerm_kubernetes_cluster

Terraform Configuration Files

provider "azurerm" {
  version         = "1.32"
  subscription_id = "${var.subscription_id}"
  client_id       = "${var.client_id}"
  client_secret   = "${var.client_secret}"
  tenant_id       = "${var.tenant_id}"
}

resource "azurerm_subnet" "k8s-subnet" {
  name                 = "${var.cluster_name}"
  address_prefix       = "${var.subnet_address_prefix}"
  virtual_network_name = "${var.virtual_network_name}"
  resource_group_name  = "${var.subnet_resource_group_name}"
}

resource "azurerm_kubernetes_cluster" "k8s-internal" {
  name                = "${var.cluster_name}"
  location            = "${var.location}"
  resource_group_name = "${var.resource_group_name}"
  dns_prefix          = "${var.dns_prefix}"
  kubernetes_version  = "1.13.7"

  agent_pool_profile {
    name            = "default"
    count           = "${var.agent_count}"
    vm_size         = "${var.agent_type}"
    os_type         = "Linux"
    os_disk_size_gb = 30
    vnet_subnet_id  = "${azurerm_subnet.k8s-subnet.id}"
    max_pods        = "${var.max_pods}"
  }

  service_principal {
    client_id     = "${var.client_id}"
    client_secret = "${var.client_secret}"
  }

  network_profile {
    network_plugin     = "azure"
    service_cidr       = "${var.network_service_cidr}"
    dns_service_ip     = "${var.network_dns_service_ip}"
    docker_bridge_cidr = "${var.network_docker_bridge_cidr}"
  }

  tags = {
    Environment = "Development"
  }

  role_based_access_control {
    enabled = true
  }
}

Expected Behavior

Updated azurerm version to 1.32.
Expected just to update/modify the cluster to desired.

Actual Behavior

Terraform wants to recreate the resource:
load_balancer_sku = "Basic" -> "basic" # forces replacement

This breaks our Terraform states. the problem is that we cant get around it, we can keep using 1.31 but not a valid option for long. We cant specify the load_balancer_sku to use a capital "B" in "basic", then it complains.

Any insights ?

Steps to Reproduce

  1. Update azurerm to 1.32 in your tf files.
  2. make a simple change which should only cause a "modify".
  3. terraform apply or terraform plan

References

@wrighbr
Copy link

wrighbr commented Jul 29, 2019

👍

@brondum
Copy link
Author

brondum commented Jul 29, 2019

Additional info:
As far as i can tell, when querying azure, load balancer sku values is actually with capital e.g.
az network lb show -g <some_group> -n <some_lb>

 "sku": {
    "name": "Basic",
    "tier": "Regional"
  },

@mbfrahry
Copy link
Member

Hey @brondum. It looks like some assumptions were made with the sdk not taking casing other than lower-case. We've suppressed casing entirely and you should be able to pass upper or lower casing to the api in the next release.

@brondum
Copy link
Author

brondum commented Jul 30, 2019

@mbfrahry Thank you for investigating, and looking forward to the fix :)

@ghost
Copy link

ghost commented Aug 1, 2019

This has been released in version 1.32.1 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 1.32.1"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Aug 29, 2019

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 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Aug 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants