Exposing an application to the internet
Awesome job so far, so to finish this chapter, let's make our application available over the internet.
We need to update service.yaml
with type: LoadBalancer
, which will create a LoadBalancer with an external IP.
Note
The LoadBalancer capability is dependent on the vendor integration because an external LoadBalancer is created by the vendor. So, if you run locally with Minikube or Kind, you will never really get an external IP.
Update the service.yaml
file with the following content:
... spec: Â Â type: LoadBalancer ...
To deploy the new changes, run the $ kubectl apply -f service.yaml
command followed by the get
command as shown in the following screenshot:
We are seeing pending
as the status depends on the cloud provider, and it can take up to 5 minutes for the LoadBalancer to be provisioned. Running the get
command again after some...