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

Support for outputting the name of the VMSS within AKS clusters #6217

Closed
BrendanThompson opened this issue Mar 23, 2020 · 3 comments
Closed
Labels
enhancement sdk/not-yet-supported Support for this does not exist in the upstream SDK at this time service/kubernetes-cluster upstream/microsoft Indicates that there's an upstream issue blocking this issue/PR

Comments

@BrendanThompson
Copy link
Contributor

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

Description

When trying to do such things as create alerts with Azure Monitor, the metrics available on the Azure Kubernetes Service resource type are utterly useless, this means that in order to get any valuable information out of the platform it is required to query against the VMSS for each Agent Pool. Currently, there is no mechanism for getting the VMSS name out of Terraform.

It would be ideal that if part of the data "azurerm_kubernetes_cluster" "this" {} data source that this information was exposed for such use cases as above.

New or Affected Resource(s)

  • azurerm_kubernetes_cluster [ Data Source ]

Potential Terraform Configuration

data "azurerm_kubernetes_cluster" "this" {
  name = "aks"
  resource_group_name = "rg-aks"
}

output "vmss_name" {
  value = data.azurerm_kubernetes_cluster.this.agent_pool_profile.0.vmss_name
}

References

@aristosvo
Copy link
Collaborator

I like the idea of it and have a simular usecase for other AKS resource names and id's, main problem here is that the user or service principal authenticating your TerraForm actions may not have the right permissions on the resource group where the resources for AKS are living. If we don't want to break the data source for these people, we need something smart or exposure of the data via the AKS REST API.

So the first question is probably if we can get Microsoft to expose the internals of AKS via the AKS REST API. I think they won't.

The other option, something smart which checks the permissions on the resource group of your AKS resources, gets the name of the VMSS per Agent Pool and exposes the data if you have permissions. I don't think we want to do that either, as you're then basically extending Microsoft's AKS API and implementing it in TerraForm. It's a nice challenge though 😎.

@katbyte: any other suggestions?

@tombuildsstuff
Copy link
Contributor

hey @BrendanThompson @aristosvo

Thanks for opening this issue.

Taking a look into this as @aristosvo has mentioned this is an implementation detail of AKS which currently isn't (and arguably shouldn't be, since they're dynamic in a scale-set, and non-VMSS AKS Node Pools are superseded). That said, it should be possible to achieve this using by installing the monitoring on the VMSS created by AKS - rather than the individual nodes, since monitoring can be achieved as a VM Extension, and applied to all existing/new nodes.

At this time AKS doesn't expose the ID of the VM Scale Set being used - as such before we'd be able to expose this information we'd need the AKS Service to expose this information - as such I'd suggest opening an issue on the AKS Repository where when that's available we should be able to export this, for both the Cluster and the associated Node Pools.

Since this isn't something that's currently possible (since this information isn't available in the API) - I'm going to close this issue for the moment, however if/when this becomes available in the AKS API we can look into adding support for this :)

Thanks!

@tombuildsstuff tombuildsstuff added upstream/microsoft Indicates that there's an upstream issue blocking this issue/PR sdk/not-yet-supported Support for this does not exist in the upstream SDK at this time labels Apr 16, 2020
@ghost
Copy link

ghost commented May 16, 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 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators May 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement sdk/not-yet-supported Support for this does not exist in the upstream SDK at this time service/kubernetes-cluster upstream/microsoft Indicates that there's an upstream issue blocking this issue/PR
Projects
None yet
Development

No branches or pull requests

4 participants