45 lines
1.4 KiB
HCL
45 lines
1.4 KiB
HCL
output "control_plane_ips" {
|
|
description = "Public IPs of control plane nodes"
|
|
value = [for cp in hcloud_server.control_plane : cp.ipv4_address]
|
|
}
|
|
|
|
output "control_plane_private_ips" {
|
|
description = "Private IPs of control plane nodes"
|
|
value = [for cp in hcloud_server.control_plane : one(cp.network).ip]
|
|
}
|
|
|
|
output "primary_control_plane_ip" {
|
|
description = "Public IP of the primary control plane (first node)"
|
|
value = hcloud_server.control_plane[0].ipv4_address
|
|
}
|
|
|
|
output "worker_ips" {
|
|
description = "Public IPs of worker nodes"
|
|
value = [for worker in hcloud_server.workers : worker.ipv4_address]
|
|
}
|
|
|
|
output "worker_private_ips" {
|
|
description = "Private IPs of worker nodes"
|
|
value = [for worker in hcloud_server.workers : one(worker.network).ip]
|
|
}
|
|
|
|
output "ssh_private_key_path" {
|
|
description = "Path to SSH private key"
|
|
value = var.ssh_private_key
|
|
}
|
|
|
|
output "cluster_name" {
|
|
description = "Cluster name"
|
|
value = var.cluster_name
|
|
}
|
|
|
|
output "network_cidr" {
|
|
description = "Private network CIDR"
|
|
value = var.subnet_cidr
|
|
}
|
|
|
|
output "kubeconfig_command" {
|
|
description = "Command to fetch kubeconfig"
|
|
value = "ssh root@${hcloud_server.control_plane[0].ipv4_address} 'cat /etc/rancher/k3s/k3s.yaml' > kubeconfig && sed -i 's/127.0.0.1/${hcloud_server.control_plane[0].ipv4_address}/g' kubeconfig"
|
|
}
|