-
Notifications
You must be signed in to change notification settings - Fork 2
/
outputs.tf
52 lines (45 loc) · 2.17 KB
/
outputs.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
output "cluster_id" {
description = "Kubernetes cluster ID."
value = try(nebius_kubernetes_cluster.kube_cluster.id, null)
}
output "cluster_name" {
description = "Kubernetes cluster name."
value = try(nebius_kubernetes_cluster.kube_cluster.name, null)
}
output "external_v4_endpoint" {
description = "Kubernetes external IPv4 endpoint."
value = nebius_kubernetes_cluster.kube_cluster.master[0].external_v4_endpoint
}
output "internal_v4_endpoint" {
description = "Kubernetes internal IPv4 endpoint."
value = nebius_kubernetes_cluster.kube_cluster.master[0].internal_v4_endpoint
}
output "cluster_ca_certificate" {
description = "Kubernetes cluster CA certificate."
value = nebius_kubernetes_cluster.kube_cluster.master[0].cluster_ca_certificate
}
# public ip with kube config download command
output "external_cluster_cmd" {
description = <<EOF
Kubernetes cluster public IP address.
Use the following command to download kube config and start working with Nebius Managed Kubernetes cluster:
`$ ncp managed-kubernetes cluster get-credentials --id <cluster_id> --external`
This command will automatically add kube config for your user; after that, you will be able to test it with the
`kubectl get cluster-info` command.
EOF
value = var.public_access ? "ncp managed-kubernetes cluster get-credentials --id ${nebius_kubernetes_cluster.kube_cluster.id} --external" : null
}
# private ip with kube config download command
output "internal_cluster_cmd" {
description = <<EOF
Kubernetes cluster private IP address.
Use the following command to download kube config and start working with Nebius Managed Kubernetes cluster:
`$ ncp managed-kubernetes cluster get-credentials --id <cluster_id> --internal`
Note: Kubernetes internal cluster nodes are available from the virtual machines in the same VPC as cluster nodes.
EOF
value = var.public_access == false ? "ncp managed-kubernetes cluster get-credentials --id ${nebius_kubernetes_cluster.kube_cluster.id} --internal" : null
}
output "cluster_node_groups" {
description = "Kubernetes node groups spec"
value = nebius_kubernetes_node_group.kube_node_groups
}