Chapter 5. 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:
Deploy the frontend service:
$ kubectl create deployment hello-world-frontend --image quay.io/skupper/hello-world-frontend
Expose the frontend deployment as a cluster service:
$ kubectl expose deployment hello-world-frontend --port 8080 --type LoadBalancer
Create a route for the frontend:
$ kubectl expose svc/hello-world-frontend
Check the frontend route:
Get the route details:
$ oc get routes
The output should be similar to the following:
NAME HOST/PORT hello-world-frontend <frontend-url>
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 create the backend service and make it available on the service network.