Finding the external address of the service

Let's perform the following steps to get the externally reachable address of the service:

  1. List the services that use the LoadBalancer type. The EXTERNAL-IP column will show you the cloud vendor-provided address:
$ kubectl get svc |grep LoadBalancer
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
minio-service LoadBalancer 100.69.15.120 containerized.me.us-east-1.elb.amazonaws.com 9000:30705/TCP 4h39m
  1. If you are running on a cloud provider service such as AWS, you can also use the following command to get the exact address. You can copy and paste this into a web browser:
$ SERVICE_IP=http://$(kubectl get svc minio-service 
-o jsonpath='{.status.loadBalancer.ingress[0].hostname}:{.spec.ports[].targetPort}')
$ echo $SERVICE_IP
  1. If you are running on a bare-metal server, then you probably won't have a hostname entry. As an example, if you are running MetalLB (https://metallb.universe.tf/), a load balancer for bare-metal Kubernetes clusters, or SeeSaw (https://github.com/google/seesaw), a Linux Virtual Server (LVS)-based load balancing platform, you need to look for the ip entry instead:
$ SERVICE_IP=http://$(kubectl get svc minio-service 
-o jsonpath='{.status.loadBalancer.ingress[0].ip}:{.spec.ports[].targetPort}')
$ echo $SERVICE_IP

The preceding command will return a link similar to https://containerized.me.us-east-1.elb.amazonaws.com:9000.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.239.44