Hi@MD,
To expose the pod to end-users, provision a service. Service is capable of provisioning a load-balancer in some cloud providers. It can manage the relationship between pods and the load balancer while new pods are launched. You can see the below example.
resource "kubernetes_service" "echo" {
metadata {
name = "echo-example"
}
spec {
selector {
App = "${kubernetes_pod.echo.metadata.0.labels.App}"
}
port {
port = 80
target_port = 80
}
type = "LoadBalancer"
} }
output "lb_ip" {
value = "${kubernetes_service.echo.load_balancer_ingress.0.ip}"
}