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

AKS cluster creation fails when (optional) subnet_id is undefined #17937

Closed
vanappmi opened this issue Apr 26, 2018 · 5 comments
Closed

AKS cluster creation fails when (optional) subnet_id is undefined #17937

vanappmi opened this issue Apr 26, 2018 · 5 comments

Comments

@vanappmi
Copy link

Terraform Version

2018/04/26 10:36:41 [INFO] Terraform version: 0.11.7  41e50bd32a8825a84535e353c3674af8ce799161

Terraform Configuration Files

AKS configuration file

resource "azurerm_kubernetes_cluster" "container_service" {
  name                = "${local.aks_name}"
  resource_group_name = "${azurerm_resource_group.k8s_0.name}"
  location            = "${azurerm_resource_group.k8s_0.location}"
  kubernetes_version  = "${local.aks_version}"
  dns_prefix          = "${local.aks_dns_name_prefix}"

  agent_pool_profile {
    name            = "agentpools"
    count           = "${local.aks_agent_pool_count}"
    vm_size         = "${local.aks_agent_pool_vm_size}"
    os_type         = "${local.aks_agent_pool_os_type}"
    os_disk_size_gb = "${local.aks_agent_pool_os_disk_size_gb}"

    #    vnet_subnet_id = "${azurerm_subnet.aks.id}"
  }

  linux_profile {
    admin_username = "${local.linux_admin_user}"

    ssh_key {
      key_data = "${file("${path.module}/id_agents.pub")}"
    }
  }

  service_principal {
    client_id     = "${local.service_principal_client_id}"
    client_secret = "${local.service_principal_client_secret}"
  }
}

## vars
locals {
  # Global
  name_prefix             = "c11h-glass"
  resource_group_location = "westeurope"
  resource_group_name     = "glass-${terraform.workspace}"

  # AKS
  aks_name               = "${local.name_prefix}-${terraform.workspace}"
  aks_agent_pool_count   = "${terraform.workspace == "default" ? 3 : 2}"
  aks_agent_pool_vm_size = "Standard_F2s"
  aks_master_count       = 2
  aks_dns_name_prefix    = "k8s-${terraform.workspace}"

  aks_agent_pool_os_disk_size_gb = "30"
  aks_agent_pool_os_type         = "Linux"
  aks_dns_prefix                 = "${local.name_prefix}-${terraform.workspace}"
  aks_version                    = "1.9.6"

  linux_admin_user = "azadmin"
}

Debug Output

https://gist.github.com/vanappmi/d9f964aff8773ae9bca1b91ca3799926

Expected Behavior

Create an AKS cluster without the need to define an (optional) subnet_id

Actual Behavior

Only runs with pre-defined subnet_id config ( -- Original Error: Code="LinkedInvalidPropertyId" Message="Property id '' at path 'properties.agentPoolProfiles[0].vnetSubnetID' is invalid. Expect fully qualified resource Id that start with '/subscriptions/{subscriptionId}' or '/providers/{resourceProviderNamespace}/'.")

Steps to Reproduce

  1. terraform init
  2. terraform apply

Additional Context

Worked maybe a week ago. Also tried terraform 0.11.3.
Also tried different fqdn- and aks-names because of possible max-length issues.
Also, there is no sign of the problem in the Azure activity log (fails on api call)

@fmunozn
Copy link

fmunozn commented Apr 27, 2018

Hi,

The same is happening to me. I even created a Virtual network and tried to create the cluster and it didn't work either.

@Ycallaer
Copy link

Ycallaer commented Apr 30, 2018

+1
Since today I can no longer deploy my kubernetes cluster
Please fix as this is blocking kubernetes deployments

@iorlas
Copy link

iorlas commented Apr 30, 2018

+1 It is blocker in our product. Please. Please. Please.

@jbardin
Copy link
Member

jbardin commented Apr 30, 2018

This looks like a duplicate of hashicorp/terraform-provider-azurerm#1166

@jbardin jbardin closed this as completed Apr 30, 2018
@ghost
Copy link

ghost commented Apr 3, 2020

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 3, 2020
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

5 participants