Skip to content

Kubernetes

Edge Xpert on Kubernetes allows you to manage the containers that run the services.

Default Configuration

The default configuration demonstrates the basic functionality of the Edge Xpert platform, as deployed in Kubernetes.

This default configuration runs the following containers:

  • redis
  • core-command
  • core-metadata
  • core-data
  • export-client
  • export-distro
  • xpert-manager
  • device-virtual

Overall Design

The Edge Xpert license is used by the containers by way of a secret. This means that the Edge Xpert license is encoded in base64 before being transmitted to, and used by, containers.

To simplify the deployment of containers, the configMap and service for a container are specified in the container\'s deployment file. This creates a central point where all details related to the container can be found.

Some deployments contain configMaps to configure the container\'s internal configuration.toml file. These are retained to show how straightforward configuration is, and to help in troubleshooting.

Persistent volumes and persistent volume claims have individual files in their own folder. This makes deployment easier and reduces errors where a claim is created before a volume.

All persistent volumes are regarded as temporary on the host. When the host restarts, the volumes are deleted. For this reason, persistent volumes are mounted inside a /tmp path on the host to highlight this limitation.

Set Up a Secret

If you are running this example, your license key must be set up as a secret in Kubernetes. The Edge Xpert license used on the local machine to create the secret must use the same filename as that specified in the YAML deployment files.

To set up a secret called license, complete the following steps:

  1. Open a terminal

  2. Enter the following command, replacing </path/to/your/license/file> with the path to the Edge Xpert license file on your machine:

    kubectl create secret generic license --from-file=</path/to/your/license/file>
    

  3. Update the YAML file to use the same filename as that used when creating the secret

    For example, if your license is called license.lic, the YAML file must include the following:

    - mountPath: /edgexpert/licenses/license.lic
      name: license
      subPath: license.lic
    

Apply Persistent Volumes

To apply persistent volumes, complete the following steps:

  1. Open a terminal
  2. Navigate to the root directory of the example deployment
  3. Enter the following command:

    kubectl apply -f pv
    

  4. Enter the following command:

    kubectl apply -f pvc
    

Note

In the example commands above, pv and pvc are folders. If you prefer, you can apply each file individually.

Apply Deployment Files

To apply a deployment file, complete the following steps:

  1. Open a terminal
  2. Enter the following command, replacing <deployments/core-data-deployment.yaml> with the name of the deployment folder and file that you want to apply:
    kubectl create -f <deployments/core-data-deployment.yaml>
    

IOTech recommends that you apply the deployment files in the following order:

  1. redis
  2. core-metadata
  3. core-data
  4. core-command
  5. export-client
  6. export-distro
  7. xpert-manager
  8. device-virtual

Alternatively, you can deploy all files by specifying only the folder using the following command, replacing deployments with the name of the deployment folder that you want to apply:

kubectl create -f deployments

Note

Deploying all files in this way can produce non-deterministic results. IOTech recommends that this method is scripted with sleep signals added between deployments.

Edge Xpert Manager with Kubernetes

To view the Edge Xpert Manager, you must port forward port 8080 from the xpert-manager pod to the localhost address.

To view the Edge Xpert Manager, complete the following steps:

  1. Open a terminal and enter the following command, replacing <xpert-manager-58958db69b-2jc7q> with the name of the pod running the Edge Xpert Manager:

    kubectl port-forward <xpert-manager-58958db69b-pj9jf 8080:8080>
    

    Note

    The number and letters following the pod name differ for each deployment of the pod. You can query the pod to obtain the numbers and letters required using the kubectl get pod command.

  2. Wait for the port to be forwarded, then open a web browser and enter 127.0.0.1:8080 in the Address Bar of your web browser. The Edge Xpert Manager Login page displays.

  3. Enter admin in the Username text box

  4. Enter admin in the Password text box

  5. Select the Login button

After logging in, the Devices pane displays. On the Device pane you can do the following:

  • View the metadata for the virtual devices by selecting the View Device (i) icon from the Action column for the device
  • Read device data by selecting the Control Device (speedometer) icon from the Action column for the device and selecting the refresh icon in the top right of the screen
  • Write device data by selecting the Control Device (speedometer) icon from the Action column for the device, then selecting the Set Value (edit|) icon for the data and completing the dialog box

To view the readings from the device, select READINGS from the main menu.

Back to top