Kubernetes Runtime

Learn how to run the Vehicle App Runtime Services in Kubernetes.

Besides local execution of the vehicle runtime components, another way is to deploy them as containers in a Kubernetes control plane (like K3D). To create a K3D instance, we provide Visual Studio Code Tasks, a feature of Visual Studio Code. Additional information on tasks can be found here .

Quick Start: Each step has a task that is defined in /.vscode/tasks.json:

  • Core tasks (dependent on each other in the given order):
    • K3D - Runtime Up: Starts up the K3D runtime (Including configuring control plane and initializing Dapr).
    • K3D - Build VehicleApp: Builds the VehicleApp.
    • K3D - Deploy VehicleApp: Deploys the VehicleApp via Helm to the K3D cluster.

Each task has the required dependencies defined. If you want to run the runtime in K3D, the task K3D - Deploy VehicleApp will create and configure everything. So it’s enough to run that task.

  • Optional helper tasks:
    • K3D - Deploy VehicleApp (without rebuild): Deploys the VehicleApp via Helm to the K3D cluster (without rebuilding it). That requires, that the task K3D - Build VehicleApp has been executed once before.
    • K3D - Runtime Down: Uninstalls and removes K3D runtime configuration.

K3D is configured so that Mosquitto and the KUKSA Data Broker can be reached from outside the container over the ports 31883 (Mosquitto) and 30555(KUKSA Data Broker). The test runner, that is running outside of the cluster, can interact with these services over those ports.

To check the status of your K3D instance (running pods, containers, logs, …) you can either use the kubectl utility or start K9s in a terminal window to have a terminal UI for interacting with the cluster.

Run as Bundle: To orchestrate these tasks, you can use the task K3D - Deploy VehicleApp. This task runs the other tasks in the correct order. You can run this task by clicking F1 and choose Tasks: Run task, then select K3D - Deploy VehicleApp.

Tasks Management: Visual Studio Code offers various other commands concerning tasks like Start/Terminate/Restart/… You can access them by pressing F1 and typing task. A list with available task commands will appear.

Logging: Running tasks appear in the Terminals View of Visual Studio Code. From there, you can see the logs of each running task. More detailed logs can be found inside your workspace’s logs directory ./logs/*

Uploading files to persistentVolume

Some applications (e.g. FeederCAN) might make it necessary to load custom files from mounted volume. For that reason, persistentVolume is created in k3d cluster. All the files that are located in [./config/feedercan](https://github.com/eclipse-velocitas/devenv-runtimes/tree/main/config/feedercan) will be uploaded to the k3d cluster dynamically. In order to mount files to the directory that is accessible by the application, please refer to the deployment configuration file: runtime-k3d/src/runtime/deployment/config/helm/templates/persistentVolume.yaml .

Changes in ./config/feedercan are automatically reflected in PersistentVolume.

Uploading custom candump file to FeederCAN

FeederCAN requires a candump file. A pre-defined candump file is already part of our delivery, however, if necessary, there is an option to upload a custom file by:

  1. Creating/updating candump file with the name candumpDefault.log in ./config/feedercan
  2. Recreating the feedercan pod: kubectl delete pods -l app=feedercan

More information about FeederCan can be found here

Next steps