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

feature request: Use azurerm_kubernetes_cluster to populate kubernetes provider #947

Closed
jambt opened this issue Mar 7, 2018 · 2 comments

Comments

@jambt
Copy link

jambt commented Mar 7, 2018

Hi,

it would be great if one could use azurerm_kubernetes_cluster resources as a source to provide login information for the kubernetes provider. Then something like this would be possible:

Terraform Configuration Files

resource "azurerm_kubernetes_cluster" "aks_container" {
  name                = "${var.name}"
  location            = "${var.location}"
  resource_group_name = "${var.resource_group}"
  kubernetes_version  = "1.8.7"
  dns_prefix          = "default"

  linux_profile {
    admin_username = "admin_user"

    ssh_key {
      key_data = "${file("~/.ssh/id_rsa.pub")}"
    }
  }

  agent_pool_profile {
    name    = "agentpool"
    count   = "${var.node_count}"
    vm_size = "${var.node_vm_size}"
    os_type = "Linux"
  }

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

resource "kubernetes_pod" "test" {
  login = ${azurerm_kubernetes_cluster.aks_cluster}

  metadata {
    name = "terraform-example"
  }

  spec {
    container {
      image = "nginx:1.7.9"
      name  = "example"
    }
  }
}

Note that I made up the login field.

As a workaround, I am exerimenting with a null_resource using a local_exec provisionar that calls az aks get-credentials. However, this seems not to be reliable.

@jambt
Copy link
Author

jambt commented Mar 7, 2018

My bad, its a duplicate of #934.

Sorry I was unable to find that earlier. Closing myself.

@jambt jambt closed this as completed Mar 7, 2018
@ghost
Copy link

ghost commented Mar 31, 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 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!

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

No branches or pull requests

1 participant