Skip to content

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

@wombelix

Description

@wombelix

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions