Deploy the “Recommendations” Service.

Exercise 1: Create a Virtual Site with our target REs

Since we only want to deploy our “recommendations” service to a select number of Region Edges, we must define a “virtual site” that contains the REs we want to target.

  1. Start in VoltConsole and switch to your Load Balancers context.

    load_balancers_context

  2. Verify you are in your namespace

  3. Using the menu on the left, navigate to “Manage”->”Virtual Sites”. Click on Save and Exit.

    menu-vs add-vs

  4. Fill out the form.

    Variable

    Value

    Name

    recs-re

    Description

    virtual site to deploy ‘recs’ service

    Site Type

    RE

    Site Selector Expression

    ves.io/siteName in {ves-io-ny8-nyc, ves-io-wes-sea}

    vs-selector-expression add-vs-diag

  5. Verify your “recs-re” virtual site was created.

    vs-check verify-vs


Exercise 2: Deploy the “Recommendations” Workload

We’ll use the “workloads” concept to configure all the pieces we need for the “recommendations” service – the k8s deployment, the k8s service exposing the deployment in the cluster, and an HTTP Load Balancer that exposes the k8s service to the internet.

  1. Navigate to your vK8s cluster from the Virtual K8s menu item under “Applications”. Click the cluster’s name.

    vk8s-deets

  2. Click the Workloads tab followed by the Add vK8s workload button.

    recs-add-wl

  3. Fill out the form:

    Variable

    Value

    Name

    brews-recs

    Select Type of Workload

    Service

  4. Under the “Service” section, click the Configure link.

  5. Enter the following variables in the Containers section.

    Variable

    Value

    Name

    brews-recs

    Image Name

    f5demos.azurecr.io/recs

    Select Container Registry

    Private Registry

    Private Registry

    Select the private registry you created previously

    recs-container

  6. Enter the following variables in the Deploy Options section.

    Variable

    Value

    Where to Deploy the workload

    Customer Virtual Sites

  7. Under Customer Virtual Sites, click the Configure link.

  8. Select the Virtual Site of REs you created in the previous section.

    recs-vs

  9. Click the Apply button to close the “Deploy” dialogue.

  10. Under Advertise Option, choose Advertise On Internet. Click the Configure link.

    recs-advertise

  11. Enter the port (8001) for the “Recommendations” service.

    new-recs-advertise-port

  12. Verify that “HTTP/HTTPS Load Balancer” is selected under “Options to Advertise the workload”. Click Configure.

  13. Enter the following variables:

    Variable

    Value

    Domains

    [unique name]-recs.[supplied domain name for your tenant]

    Select type of Load Balancer

    HTTP

    Automatically Manage DNS Records

    Yes/Check

    recs-lb

  14. Click the Show Advanced Fields toggle in the “Routes” section. Select ‘Disable Host Rewrite’ for the default route.

    recs-lb-advanced recs-stupidness

    Note

    The default route configuration, to rewrite the “Host” header with the name of an upstream server, is not applicable when the service is hosted on Regional Edges.

  15. Click Apply to close the “HTTP/HTTPS Load Balancer” dialogue.

  16. Click Apply to close the “Advertise On Internet” dialogue.

  17. Click Apply to close the “Service” dialogue.

  18. Click Save and Exit to create the Workload.

  19. Verify the workload.

    recs-wl-verify recs-wl-verify2


Exercise 3: Reconfigure the SPA to use the “Recommendations” feature.

Now that “recommendations” service is online, we need to reconfigure the SPA to use it.

  1. Open the demo application in your browser

    Note

    If you do not remember the FQDN, you can look under Manage -> HTTP Load Balancers to find it.

  2. Click on the information icon

    demo_app_stats

  3. Click on the gear icon for the “Recommendations” service.

    demo-app-config-recs

  4. Enter the domain we added to the “brews-recs” HTTP Load Balancer.

    demo-app-config-recs-url

  5. Click the button or press Enter

If everything is working correctly, your “Recommendations” card should not turn red. HTTP response time statistics should start being populated in the card. When you view product details in the main application, you should see additional brew recommendations.

recs-recs


Packet flow

Below is the packet flow for the architecture you just deployed in Volterra.

flow_state5




Attention

Congratulations, you have reached the end of this core exercises of this course!.

../../_images/stop.png

If you are interested in completing the optional exercises, please feel free to click next to continue.