module.aks.azurerm_monitor_diagnostic_setting.aks[0]: Refreshing state... [id=/subscriptions/11c8cdfe-6cbb-447f-912a-17524f161f7b/resourceGroups/tf-azure-aks-b4c31cdc-ci-TestNetworkPlugin/providers/Microsoft.ContainerService/managedClusters/tf-azure-aks-b4c31cdc-ci-TestNetworkPlugin-k8s|tf-azure-aks-b4c31cdc-ci-TestNetworkPlugin-diagnotic-setting]
module.aks.time_sleep.wait_for_aks_cluster_admin_tf_identity_propagation: Refreshing state... [id=2023-07-11T17:29:06Z]
module.aks.kubernetes_storage_class.azureFileStandardZRSRetain: Refreshing state... [id=azurefile-standard-zrs-retain]
│ Error: storageclasses.storage.k8s.io "azurefile-standard-zrs-retain" is forbidden: User "system:serviceaccount:xinfra-ci:default" cannot get resource "storageclasses" in API group "storage.k8s.io" at the cluster scope: Azure does not have opinion for this user.
│
│ with module.aks.kubernetes_storage_class.azureFileStandardZRSRetain,
│ on ../../infra_specs.tf line 260, in resource "kubernetes_storage_class" "azureFileStandardZRSRetain":
│ 260: resource "kubernetes_storage_class" "azureFileStandardZRSRetain" {
│
╵
Expected Behaviour
Terraform should have used the configuration provided to the kubernetes provider. The actual debug doesn't reveal where its pulling the kubeconfig from, but its the default and/or whatever kubernetes environment variables are set by our gitlab runner. The k8s provider config never gets read.
I'm aware that this appears more related to the kubernetes provider, but when I remove the network_plugin_mode related parameters for azurerm_kubernetes_cluster, everything goes back to operating correctly.
Actual Behaviour
Terraform ignores the kubernetes provider configuration and instead appears to use defaults of localhost:80.
Is there an existing issue for this?
Community Note
Terraform Version
1.2.1
AzureRM Provider Version
3.64.0
Affected Resource(s)/Data Source(s)
azurerm_kubernetes_cluster
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Terraform should have used the configuration provided to the kubernetes provider. The actual debug doesn't reveal where its pulling the kubeconfig from, but its the default and/or whatever kubernetes environment variables are set by our gitlab runner. The k8s provider config never gets read.
I'm aware that this appears more related to the kubernetes provider, but when I remove the
network_plugin_mode
related parameters forazurerm_kubernetes_cluster
, everything goes back to operating correctly.Actual Behaviour
Terraform ignores the kubernetes provider configuration and instead appears to use defaults of localhost:80.
Steps to Reproduce
terraform apply
# This succeeds when none of the resources existterraform destroy
orterraform apply
# This fails when refreshing the state when it reaches the k8s resourcesazurerm_kubernetes_cluster
parameters above and everything works as expected.Important Factoids
No response
References
No response