Open ajchiarello opened 4 years ago
@ajchiarello I had the same problem, I thought the same way about getting the ips using the rancher2_node_pool
, but discover a more effective way using: rancher2_cluster_sync
and use its output to get the ips, but I specify the nodes output along with ip_address or external_ip_address, it depends on what you are going to use.
remembering that the output is in list form, even with only 1 host. Below I show an example and how I get the IP address.
resource "rancher2_cluster_sync" "prod" {
cluster_id = rancher2_cluster.prod.id
node_pool_ids = [rancher2_node_pool.nodepool_worker.id]
}
Now we can get the IP of the nodes and use where, I'm just getting the internal ip of my node like this:
rancher2_cluster_sync.prod.nodes[0].ip_address
I hope it helped you!
When creating a node pool, is there any way to get the IP addresses of the nodes that have been created? I am using the authorized cluster endpoint feature and need to add my controlplane nodes to my load balancer.