Open kriswuollett opened 2 years ago
It sort of makes sense that test_ingress
gives the cluster member IP. And so I just tried the following that works:
examples/kubernetes/outputs.tf
output "test_url" {
value = module.kubernetes-config.test_url
}
examples/kubernetes/kubernetes-config/main.tf
data "kubernetes_service" "nginx-ingress-controller" {
metadata {
name = "nginx-ingress-controller"
namespace = kubernetes_namespace.test.metadata.0.name
}
}
examples/kubernetes/kubernetes-config/outputs.tf
output "test_url" {
value = "http://${data.kubernetes_service.nginx-ingress-controller.status.0.load_balancer.0.ingress.0.ip}/test"
}
Having test_url
in the example is nice since it can provide a clickable link in some terminals. But in practice also showing how to get the IP would be useful for setting up other resources like DNS entries.
Something like this seems a reasonable thing to add to the example?
I followed the Kubernetes example and tried adding the following outputs as seen in the
kubernetes_service
data source:The
load_balancer_ip
appears to be a droplet IP address and not the external IP of the Load Balancer that was created. I'm not too sure that is an actual bug, so perhaps it would be nice if the Kubernetes example showed how to output the external IP whether through thekubernetes
ordigitialocean
providers.