When I run Terrorform Apply for the first time, the cluster becomes active on Rancher UI.
Then, the next time I run Terrorform Apply, the Rancher agent gets disconnected from the cluster on the Rancher UI.
terraform apply output
# module.eks_post_config.kubectl_manifest.metrics_server["/apis/apps/v1/namespaces/cattle-system/deployments/cattle-cluster-agent"] will be updated in-place
~ resource "kubectl_manifest" "metrics_server" {
id = "/apis/apps/v1/namespaces/cattle-system/deployments/cattle-cluster-agent"
name = "cattle-cluster-agent"
~ yaml_incluster = (sensitive value)
# (14 unchanged attributes hidden)
}
# module.eks_post_config.local_file.rancher-agent-registration[0] must be replaced
-/+ resource "local_file" "rancher-agent-registration" {
~ content_base64sha256 = "kDcpe8B74ceAEt/cSh+MvI0d7/PwDL3vVjaFJn77210=" -> (known after apply)
~ content_base64sha512 = "kwUcIB6ywYv/3o/drOsXyaau/QL2cu4NAlHqMzw5THIcP6zFXzj1b3PgCPAqGsdrUgOaWOOvKPrvehd9CNuJfA==" -> (known after apply)
~ content_md5 = "6be6402179a0e7f7b5c15840a10d187a" -> (known after apply)
~ content_sha1 = "f6dc040c9c6db8e8edb1d7d97624ef76cf4e84d8" -> (known after apply)
~ content_sha256 = "9037297bc07be1c78012dfdc4a1f8cbc8d1deff3f00cbdef563685267efbdb5d" -> (known after apply)
~ content_sha512 = "93051c201eb2c18bffde8fddaceb17c9a6aefd02f672ee0d0251ea333c394c721c3facc55f38f56f73e008f02a1ac76b52039a58e3af28faef7a177d08db897c" -> (known after apply)
~ filename = "../../modules/eks_post_config/2024-05-07T10:22:17Z-rancher.yml" -> (known after apply) # forces replacement
~ id = "f6dc040c9c6db8e8edb1d7d97624ef76cf4e84d8" -> (known after apply)
# (3 unchanged attributes hidden)
}
And updates the cattle-cluster-agent. Why does this happen, I am not able to understand. Is this a bug from Terraform's side?
Is there any solution to this?
I am using the generic option to import the clusters on Rancher so that multiple clusters can be imported.
Hi, I created a cluster with RKE and registered it with Rancher like this:
rancher.tf
data.tf
inputs.tf
providers.tf
terrafrom.tfvars
When I run Terrorform Apply for the first time, the cluster becomes active on Rancher UI.
Then, the next time I run Terrorform Apply, the Rancher agent gets disconnected from the cluster on the Rancher UI.
And updates the cattle-cluster-agent. Why does this happen, I am not able to understand. Is this a bug from Terraform's side? Is there any solution to this?
I am using the generic option to import the clusters on Rancher so that multiple clusters can be imported.
Is there any solution to this? Please help me.