stackitcloud / terraform-provider-stackit

The official Terraform provider for STACKIT
https://registry.terraform.io/providers/stackitcloud/stackit
Apache License 2.0
31 stars 12 forks source link

Provider Produced Inconsistent Result After Apply When Using Stackit SKE with Local Terraform Module #394

Open RohitKolhe opened 1 month ago

RohitKolhe commented 1 month ago

Description: When attempting to deploy the SKE using a local Terraform module, we encountered an error that did not occur when deploying the SKE resource directly.

Environment: Stackit Version: ~> 0.18.1 Terraform Version: 1.8.0 Provider: registry.terraform.io/stackitcloud/stackit

Error Details: When running terraform apply, we receive the following error message:

│ Error: Provider produced inconsistent result after apply │ │ When applying changes to module.ske.stackit_ske_cluster.ske, provider │ "provider[\"registry.terraform.io/stackitcloud/stackit\"]" produced an unexpected new value: │ .node_pools[0].taints: was cty.ListValEmpty(cty.Object(map[string]cty.Type{"effect":cty.String, │ "key":cty.String, "value":cty.String})), but now null. │ │ This is a bug in the provider, which should be reported in the provider's own issue tracker.

GokceGK commented 1 month ago

Hello @RohitKolhe, thanks for reporting the issue. Could you please send us your configuration? We are currently investigating and trying to reproduce the issue.

RohitKolhe commented 1 month ago

root module

resource "stackit_network" "vpc" { project_id = var.project_id name = "test-vpc" nameservers = [ "1.1.1.1", "8.8.8.8", "9.9.9.9" ] ipv4_prefix_length = 22 }

module "ske" { source = "../modules/stackit-kubernetes-cluster" name = var.kubernetes_cluster_name project_id = var.project_id kubernetes_version_min = var.kubernetes_version_min #1.28.10 maintenance = { enable_kubernetes_version_updates = true enable_machine_image_version_updates = true start = "01:00:00Z" end = "02:00:00Z" } network = { id = stackit_network.vpc.network_id } node_pools = [ { name = "system" machine_type = "c1.2" minimum = "1" maximum = "3" availability_zones = ["eu01-1", "eu01-2", "eu01-3"] } ] extensions = { acl = { enabled = true allowed_cidrs = var.allowed_cidrs } } }

local module resource

resource "stackit_ske_cluster" "ske" {

name = var.name project_id = var.project_id extensions = var.extensions kubernetes_version_min = var.kubernetes_version_min maintenance = var.maintenance network = var.network node_pools = var.node_pools }

resource "stackit_ske_kubeconfig" "kubeconfig" { depends_on = [ stackit_ske_cluster.ske ] project_id = var.project_id cluster_name = var.name refresh = true }

DiogoFerrao commented 1 month ago

Hey @RohitKolhe,

Apologies for the delay in getting back to you.

I've been investigating the issue you reported. To help me diagnose it more effectively, could you please share the definition of your locally defined module stackit-kubernetes-cluster? This would greatly assist in pinpointing the root cause of the problem.

From the configuration you provided, it seems the error related to taints is unexpected since they aren't defined in the nodepool. It's possible that something within the Module setup might be triggering this internal error on our end.

I haven't been able to replicate the bug on my side yet. Any additional details or context you can provide would be immensely helpful in resolving this issue.

Thank you for your patience and cooperation!

DiogoFerrao commented 6 days ago

Hey @RohitKolhe, do you have any updates on this? We have since diagnosed and solved a bug related with the taints field (see #456).

Maybe this also solved you case?