The below example shows how Host groups can be used to deploy Kubernetes workloads. This requires a camera attached to a device to receive the workload that monitors feed from that device.

Procedure

  1. Go to the Hosts page in the VMware Edge Compute Stack service and select the hosts for which you want to create a group.
  2. Click ADD HOST TO GROUP.
  3. Provide the required details:

    Option

    Description

    Group Description

    Enter a description for the host group.

    Group Label Key

    Enter a label key.

    Group Label Value

    Enter a label value.

    The following is an example:

    Figure 1. Example Host Group Creation
  4. Click OK.

    The group is sent to the host (or hosts) and activated for use.

  5. In the deployment details, within your application specification, you can use this group as a nodeSelector to deploy only to hosts that have the label of cameraattached.

    Example deployment specification showing nodeSelector:

    apiVersion: apps/v1
    kind: Deployment
    ...
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: camera-app
      strategy:
        type: Recreate
      template:
        metadata:
          labels:
            app: camera-app
        spec:
          nodeSelector:
            cameraattached: "true"
          containers:
            ...