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

API Service

As you know, the web service in the SynergyChat system serves the front-end assets (HTML, CSS, and JavaScript) to the user's browser. The api service is responsible for handling requests from the front-end and returning data from the database.

Let's add a "NodePort" type service to expose the api service to the outside world.

Assignment

Create a copy of your web-service.yaml file and name it api-service.yaml. Change the following:

  1. The name should be api-service
  2. Make sure it selects pods using the app: synergychat-api key
  3. Add type: NodePort to the spec section
  4. Add nodePort: 30080 to the first object in the ports list

Here are the docs for the NodePort service type in case you get lost.

Once you've made the changes, apply the service. Then check to make sure the service is running:

kubectl get svc

Next, run:

kubectl proxy

Run and submit the CLI tests.