Virtual Kubernetes

In this section we will create a Virtual K8s configuration in F5 Distributed Cloud Console.


Exercise 1: Create Virtual K8s

  1. In F5 Distributed Cloud Console ensure you are in the Distributed Apps context and have selected your namespace.

    app-context lu-ns

  2. Ensure you have selected your assigned namespace

    lu-ns

  3. Navigate the menu to go to Application->*Virtual K8s*.

    vk8s_menu

  4. Click the Add Virtual K8s button.

  5. Enter the following variables:

    Variable

    Value

    Name

    your_namespace-vk8s

  6. Click the Select Vsite Ref button.

  7. Select the Virtual Site you created.

  8. Click the Select Vsite Ref button.

    vk8s_vsite_ref

  9. Click the Save and Exit button.

F5 Distributed Cloud Console will now create your Virtual K8s cluster.

vk8s_cluster


Exercise 2: Create Virtual K8s Workload for the Single-page App

  1. Once your Virtual K8s cluster is ready, select the cluster name in the Virtual K8s list.

    vk8s_list

  2. Click the Workloads tab.

    k8s_workloads_menu

  3. Click the Add vK8s workload button.

  4. Enter the following variables:

    Variable

    Value

    Name

    brews-spa

    Select Type of Workload

    Service

  5. Under the Service section, click the Configure link.

  6. Enter the following variables in the Containers section.

    Variable

    Value

    Name

    brews-spa

    Image Name

    f5demos.azurecr.io/spa

    Select Container Registry

    Private Registry

    Private Registry

    Select the private registry you created previously

    vk8s_workloads_containers

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

    Variable

    Value

    Where to Deploy the workload

    Customer Virtual Sites

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

    vk8s_workloads_deploy

  9. Select the Virtual Site you created in the previous section.

  10. Click the Apply button.

  11. Under Advertise Option, choose Advertise In Cluster.

    vk8s_workloads_advertise

  12. Click on the Configure link, and enter the following variables:

    Variable

    Value

    Port

    8081

    Show Advance Fields

    Toggle On

    Port Information

    Different than Port

    Different than Port

    80

    vk8s_advertise_port

  13. Click the Apply button.

  14. Click the Apply button.

  15. Click the Save and Exit button.


Exercise 3: Create Virtual K8s Workload for the API

  1. Click the Workloads tab.

    k8s_workloads_menu

  2. Click the Add vK8s workload button.

  3. Enter the following variables:

    Variable

    Value

    Name

    brews-api

    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-api

    Image Name

    f5demos.azurecr.io/api

    Select Container Registry

    Private Registry

    Private Registry

    Select the private registry you created previously

    vk8s_workloads_containers_api

  6. Configuration

    • Under the Configuration section click the Add item button.

    • Enter the following variables:

      Variable

      Value

      Select Configuration Parameter Type

      Environment Variable

      Name

      MONGO_URL

      Value

      your_namespace-mongodb.brews.local

      vk8s_workloads_env

  7. Enter the following variables in the Deploy Options section:

    Variable

    Value

    Where to Deploy the workload

    Customer Virtual Sites

    vk8s_workloads_deploy

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

  9. Select the Virtual Site you created in the previous section.

  10. Click the Apply button to close the “Deploy Options” dialogue.

  11. Under Advertise Option, choose Advertise In Cluster. (default is Advertise in Cluster)

    vk8s_workloads_advertise

  12. Click on Configure

  13. Enter the following variables:

    Variable

    Value

    Port

    8000

  14. Click the Apply button to close the “Advertise Options” dialogue.

  15. Click the Apply button to close the “Service” dialogue.

  16. Click the Save and Exit button to create the Workload.

You should now see your two workloads with 1 Running/Completed Pods per workload.

vk8s_workloads_list

Note

The vK8s Workload target is the Virtual Site abstraction. If DemoBrews spun up a new Customer Edge site, regardless of CSP, and tagged the site with the correct site selector the workload would be deployed to the new site and the service would be exposed via the HTTP Load Balancer automatically.