Open olivierboudet opened 11 months ago
IIUC, nutanix_karbon_cluster
creates 1 worker_node_pool and nutanix_karbon_worker_nodepool
creates another worker_node_pool . when we run 2nd terraform apply, it sees a change in worker_node_pool as there is only 1 worker_node_pool in tfconfig for nutanix_karbon_cluster
resource and in addition, we have added second worker_node_pool using nutanix_karbon_worker_nodepool
resource to the existing infra, so terraform plans detects a change as now there will be 2 worker_nodes_pool present in cluster. hence it is replacing.
you can use lifecylce to ignore changes in nutanix_karbon_cluster
for node_pool.
lifecycle { ignore_changes = [ worker_node_pool, ] }
if I add lifecycle { ignore_changes = [ worker_node_pool, ] }
terraform does not see changes anymore each time I run apply
.
But it does not allow to add new node pools after the creation of the cluster. If I try to add a new node pool, I have another error :
│ Error: unable to expand node pool during flattening: nodepool name must be passed
│
│ with nutanix_karbon_cluster.mycluster,
│ on nke.tf line 1, in resource "nutanix_karbon_cluster" "mycluster":
│ 1: resource "nutanix_karbon_cluster" "mycluster" {
│
I am just adding a new nodepool:
resource "nutanix_karbon_worker_nodepool" "test" {
cluster_name = nutanix_karbon_cluster.mycluster.name
name = "test"
num_instances = 1
node_os_version = "ntnx-1.5"
ahv_config {
cpu = 2
memory_mib = 8192
network_uuid = nutanix_subnet.kubernetes.id
prism_element_cluster_uuid = "0005f937-ba91-1d58-3f59-00620b61f748"
}
labels={
partner="test"
}
}
It looks like, after the creation of the cluster we can not change its node configuration at all...
Nutanix Cluster Information
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
I expect running
terraform apply
twice should not detect any changes.Actual Behavior
The first command
terraform apply
creates the cluster and the nodepool. Running the commandterraform apply
a second time forces a replacement :Steps to Reproduce
terraform apply
terraform apply
Important Factors
References