forked from terraform-yc-modules/terraform-yc-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
outputs.tf
32 lines (29 loc) · 1.52 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
output "cluster_id" {
description = "Kubernetes cluster ID."
value = try(yandex_kubernetes_cluster.kube_cluster.id, null)
}
output "cluster_name" {
description = "Kubernetes cluster name."
value = try(yandex_kubernetes_cluster.kube_cluster.name, null)
}
# 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 Yandex Managed Kubernetes cluster:
`$ yc 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 ? "yc managed-kubernetes cluster get-credentials --id ${yandex_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 Yandex Managed Kubernetes cluster:
`$ yc 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 ? "yc managed-kubernetes cluster get-credentials --id ${yandex_kubernetes_cluster.kube_cluster.id} --internal" : null
}