We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Change API Service

Remember how I said that NodePort and LoadBalancer services are used to expose services to the outside world? That's true, but in most cloud-based Kubernetes environments, you'll actually use a Gateway object to expose your services. The Gateway object not only exposes your service to the outside world, but also allows you to do things like:

  • Host multiple services on the same IP address
  • Host multiple services on the same port (path-based routing)
  • Terminate SSL
  • Integrate directly with external DNS and load balancers

Because we'll be setting up a Gateway in the next chapter anyway, there's no reason to expose the API service with a NodePort service. Let's change it back to a ClusterIP service.

Assignment

Switch the api-service back to a ClusterIP service. Then run:

kubectl proxy

Run and submit the CLI tests.