Chapter 6. Creating the frontend service

The frontend service is a simple Python application that displays a message from the backend application.

Procedure

Perform all tasks in the west terminal session:

  1. Deploy the frontend service:

    $ kubectl create deployment hello-world-frontend --image quay.io/skupper/hello-world-frontend
  2. Expose the frontend deployment as a cluster service:

    $ kubectl expose deployment hello-world-frontend --port 8080 --type LoadBalancer
  3. Create a route for the frontend:

    $ oc expose svc/hello-world-frontend
  4. Check the frontend route:

    1. Get the route details:

      $  oc get routes

      The output should be similar to the following:

      NAME                   HOST/PORT
      hello-world-frontend   <frontend-url>
    2. Navigate to the <frontend-url> value in your browser, you see a message similar to the following because the frontend cannot communicate with the backend yet:

      Trouble! HTTPConnectionPool(host='hello-world-backend', port=8080): Max retries exceeded with url: /api/hello (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fbfcdf0d1d0>: Failed to establish a new connection: [Errno -2] Name or service not known'))

      To resolve this situation, you must make the backend service available on the service network using a gateway.