-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
Please see this comment for the explanation of the root cause.
Terraform Version, Provider Version and Kubernetes Version
Terraform version: 0.15, 1.0
Kubernetes provider version: 2.3.0
Kubernetes version: 1.19
Affected Resource(s)
- all resources
Terraform Configuration Files
Our configuration is almost identical to your aks example code, so I tried using that and replicated the behaviour.
Note - I simulated by modifying the workers_count variable in the aks-cluster directory, however this isn't actually implemented in your code. Modify line 23 to be node_count = var.workers_count, then pass a new value in via the aks-cluster module in main.tf.
Steps to Reproduce
- Update the
aks-clustermodule as directed above to support workers_count terraform apply- Change the workers_count variable to any other value
terraform plan
Expected Behavior
Terraform should display a plan showing the updated node pool count.
Actual Behavior
The following error is reported:
$ terraform plan
random_id.cluster_name: Refreshing state... [id=aE_9C3A]
module.aks-cluster.azurerm_resource_group.default: Refreshing state... [id=/subscriptions/ff83a9d2-8d6e-4c4a-8b34-641163f8c99f/resourceGroups/tf-k8s-684ffd0b70]
module.aks-cluster.azurerm_kubernetes_cluster.default: Refreshing state... [id=/subscriptions/ff83a9d2-8d6e-4c4a-8b34-641163f8c99f/resourcegroups/tf-k8s-684ffd0b70/providers/Microsoft.ContainerService/managedClusters/tf-k8s-684ffd0b70]
module.kubernetes-config.local_file.kubeconfig: Refreshing state... [id=1ca8ad3c1c7f4aff65e5eda0038b619788b0956a]
module.kubernetes-config.helm_release.nginx_ingress: Refreshing state... [id=nginx-ingress-controller]
module.kubernetes-config.kubernetes_namespace.test: Refreshing state... [id=test]
╷
│ Error: Get "http://localhost/api/v1/namespaces/test": dial tcp [::1]:80: connect: connection refused
│
│ with module.kubernetes-config.kubernetes_namespace.test,
│ on kubernetes-config/main.tf line 14, in resource "kubernetes_namespace" "test":
│ 14: resource "kubernetes_namespace" "test" {
│
╵
╷
│ Error: Kubernetes cluster unreachable: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable
│
│ with module.kubernetes-config.helm_release.nginx_ingress,
│ on kubernetes-config/main.tf line 59, in resource "helm_release" "nginx_ingress":
│ 59: resource helm_release nginx_ingress {The data source is clearly not passing back valid data, even though there is a dependency on the aks-cluster module.
fabiendelpierre, prikesh-patel, stevehipwell, dschniepp, jwillebrands and 20 more