vK8s Workload

Objective

This guide provides instructions on how to create, deploy, and advertise a virtual Kubernetes (vK8s) workload with F5® Distributed Cloud Services vK8s in F5® Distributed Cloud Console (Console). Distributed Cloud Services provide mechanisms to easily deploy applications across a global network and make them available closer to users in major metro markets. To learn more about how Distributed Cloud Services distribute application deployment, see Distributed Application Management.

To learn more about vK8s workloads, see vK8s Workload.

Using guided creation for vK8s Workload, you can create the following types of workloads:

  • Simple Service

  • Service

  • Stateful Service

  • Job

Using the instructions provided in this guide, you can perform the following:

  • Create a simple service that is deployed on all Regional Edge (RE) sites and advertised on the Internet using an HTTP load balancer.

  • Create a stateful service that is deployed on a Customer Edge (CE) site and advertised locally on the site.


Prerequisites

The following prerequisites apply:


Configuration

The configuration option to create the vK8s Workload guides you through the steps for the required configuration. This document covers each guided step and explains the required actions performed for each step.

The following video tutorial shows how to configure a simple service using vK8s workload:

Configuration Sequence

Deploying applications on the Distributed Cloud Services requires you to perform the following sequence of steps:

Phase Description
Deploy Workload to vK8s Add vK8s Workload to the created vK8s object.
Verify the Workload Status Check the workload status.

Simple Service

Deploy Workload (Simple Service) to vK8s

Step 1: Navigate to the vK8s Workload configuration.
  • Log into Console.

  • Click Distributed Apps.

Figure: Console Homepage
Figure: Console Homepage

  • Select your application namespace or create one where your application needs to be deployed.

  • Click Applications > Virtual K8s.

  • Click on the vK8s object to open its dashboard.

Note: If you did not previously create the vK8s object, then the Add Virtual K8s option will be available to create vK8s.

  • Click the Workloads tab.
Step 2: Start the workload creation process.
  • Click Add vK8s workload to open the workload creation form.

Figure: Start Workload Creation
Figure: Start Workload Creation

  • In the Metadata section, enter a name for this workload.

  • In the Select Type of Workload section, select an option from the Select Type of Workload menu. The following options are supported:

    • Select Simple service on all REs to create a simple service.

    • Select Service to create a service.

    • Select Stateful Service to create a stateful service.

    • Select Job to create a job.

This example configures a simple service.

Figure: Workload Service Options
Figure: Workload Service Options

  • Select Simple service on all REs and then click Configure.

Figure: Simple Service
Figure: Simple Service

Step 3: Configure Simple Service.

Perform the following:

Step 3.1 Configure container.
  • Click Configure.

  • In the Name field, enter a name for the container.

  • In the Image Name field, enter a name. The Image Name is the name of the Docker image to use and specified in the <path>:<imagetag> format.

Note: If your registry is a Docker Hub, then the value of the Image Name field should be specified in the docker.io/<path>:<imagetag> format.

  • From the Select Container Registry menu, select a registry option from the following:

    • Public Registry

    • Private Registry

Figure: Container
Figure: Container

  • To configure more options, click Show Advanced Fields.

  • Click Apply.

Step 3.2 Optionally, add configuration.
  • Select from the left menu or scroll to the Configuration Parameters section.

  • Click Add Item.

Figure: Configuration
Figure: Configuration

  • From the Select Configuration Parameter Type menu, select Environment Variable.

Figure: Select Environment Variable
Figure: Select Environment Variable

  • Enter the Name and Value for the environment variable.

  • Click Add Item.

Step 3.3 Configure the advertise options.
  • Select from the left menu or scroll to the Advertise Options section.

  • From the Select Advertise Options menu, select Domains and Service Port from the options.

Figure: Advertise Options
Figure: Advertise Options

  • In the Service Port field, enter the port number on which the container will listen.

  • In the List of Domain field, enter a domain.

Figure: Service Port
Figure: Service Port

Step 4 Configure persistent storage.

By default, this option is set to Disabled.

  • In the Persistence section, select Enabled from the Persistent Storage menu.

  • Configure the settings.

Step 5 Complete creating the simple service workload.
  • Click Apply to go back to the workload configuration page.

  • Click Save and Exit to finish creating the workload.

Figure: Save and Exit
Figure: Save and Exit

  • In the Workloads tab, check that the workload was created.

Verify the Workload (Simple Service) Status

Click the Deployments tab and verify that the deployment with the same name as the workload is running.


Stateful Service

Deploy Workload (Stateful Service) to vK8s

Step 1: Navigate to the vK8s Workload configuration.
  • Log into Console.

  • Click Distributed Apps.

Figure: Console Homepage
Figure: Console Homepage

  • Select your application namespace or create one where your application needs to be deployed.

  • Click Applications > Virtual K8s.

  • Click on the vK8s object to open its dashboard.

Note: If you did not previously create the vK8s object, then the Add Virtual K8s option will be available to create vK8s.

  • Click the Workloads tab.
Step 2: Start the workload creation process.
  • Click Add vK8s workload to open the workload creation form.

Figure: Start Workload Creation
Figure: Start Workload Creation

  • In the Metadata section, enter a name for this workload.

  • In the Select Type of Workload section, select an option from the Select Type of Workload menu. The following options are supported:

    • Select Simple service on all REs to create a simple service.

    • Select Service to create a service.

    • Select Stateful Service to create a stateful service.

    • Select Job to create a job.

  • Select Stateful Service and then click Configure.

Figure: Stateful Service
Figure: Stateful Service

Step 3: Configure Stateful Service.

Perform the following:

Step 3.1 Configure container.
  • Select from the left menu or scroll to the Containers section.

  • Click Add Item and then perform the following:

    • In the Name field, enter a name for the container.

    • In the Image Name field, enter a name. The Image Name is the name of the Docker image to use and specified in the <path>:<imagetag> format.

Note: If your registry is a Docker Hub, then the value of Image Name field should be specified in the docker.io/<path>:<imagetag> format.

  • From the Select Container Registry menu, select a registry option from the following:

    • Public Registry

    • Private Registry

  • To configure more options, click Show Advanced Fields.

  • Click Apply.

Step 3.2 Optionally, add configuration.
  • Select from the left menu or scroll to the Configuration section.

  • Click Add Item.

  • From the Select Configuration Parameter Type menu, select Environment Variable.

  • Enter the Name and Value for the environment variable.

  • Click Add Item.

Step 3.3 Configure persistent storage.
  • Select from the left menu or scroll to the Persistent Storage section.

  • Click Add Item.

  • In the Name field, enter a name for the storage volume.

  • In the Storage Configuration field, click Configure.

  • Enter a value (in GiB) in the Size field for the persistent storage, and then click Apply.

  • In the Volume Mount section:

    • From the Mode menu, select Read Write, and enter the Mount Path of the volume to the container.

    • Click Add Item.

Persistent Storage
Figure: Persistent Storage

Step 3.4 Optionally, configure ephemeral volume options.
  • In the Volumes section, click Show Advanced Fields.

  • Click Add Item.

  • Complete the configuration parameters and then click Add Item.

Step 3.5 Configure deploy options.
  • Select from the left menu or scroll to the Deploy Options section.

  • From the Where to Deploy the workload menu, select Customer Sites.

  • Click Configure to open the new form.

  • Select a site from the list to deploy the stateful service on.

  • Click Apply to apply the deploy configuration.

Step 3.6 Configure advertise options.
  • Select from the left menu or scroll to the Advertise Options section.

  • Select Advertise In Cluster from the options and then click Configure to open the new form.

  • Enter the port number in the Port and click on Apply to apply the advertise options. The port number is the port on which the container is listening.

Step 4 Complete creating the stateful service workload.
  • Click Apply to go back to the workload configuration page.

  • Click on Save and Exit to finish creating the workload.

  • In the Workloads tab, check that the workload was created.

Verify the Workload (Stateful Service) Status

Click the Stateful Sets tab and verify that a stateful set with the same name as the workload is running.


Concepts


API References