Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rancher AWS: Changes to rancher server node ip cause failure in rancher2_bootstrap and rancher2_cluster_v2 #242

Open
wombelix opened this issue Nov 4, 2024 · 0 comments · May be fixed by #243

Comments

@wombelix
Copy link

wombelix commented Nov 4, 2024

If changes to the rancher node ip are part of a tofu plan (or terraform plan) run, the following error will be thrown:

Plan: 5 to add, 1 to change, 4 to destroy.

Changes to Outputs:
  ~ rancher_node_ip    = "3.79.112.253" -> (known after apply)
  ~ rancher_server_url = "https://rancher.3.79.112.253.sslip.io" -> (known after apply)
╷
│ Error: Getting cluster V2: Rancher is not ready: Doing get: Get "/ping": unsupported protocol scheme ""
│ 
│   with module.rancher_common.rancher2_cluster_v2.quickstart_workload,
│   on ../rancher-common/rancher.tf line 16, in resource "rancher2_cluster_v2" "quickstart_workload":
│   16: resource "rancher2_cluster_v2" "quickstart_workload" {
│ 
╵

Reason:
rancher2_bootstrap and rancher2_cluster_v2 don't get the api url from var.rancher_server_dns, which is defined as join(".", ["rancher", aws_instance.rancher_server.public_ip, "sslip.io"]), anymore because the public_ip of the rancher_server aws resource isn't known at this point. This can also happen during tofu destroy which makes it cumbersome to get rid of previously created resources.

The most reasonable fix for this issue is to switch over to an EIP for the Rancher Server instance as already suggested in #223. This will then also solve other problems, e.g. certification issues, related to a change of the public ip.

I'm preparing a PR for this.

wombelix added a commit to wombelix/fork_rancher_quickstart that referenced this issue Nov 4, 2024
This keeps the public ip static.

Changes to the instance, e.g. shutdown/start, will not cause an assignment of a new public IP address anymore.

Solves issues were destroy failed at 'rancher2_bootstrap' and 'rancher2_cluster_v2' because the public ip was already removed.

Fixes: rancher#223

Fixes: rancher#242
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant