Skip to content

sachinkum0009/ros2-k3s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ros2-k3s

Repo for using k3s with ROS2

Dashboard Screenshot

How to Run ros2_k3s_cli

  1. Build the workspace:
colcon build --symlink-install
  1. Source the ROS2 workspace:
source install/setup.bash
  1. Run the CLI tool:
ros2 run ros2_k3s_cli cli --help

Generate Robot Pod Config

Interactively create a robot pod YAML config:

ros2 run ros2_k3s_cli cli create-config --output robot_pod_generated.yaml

You will be prompted for name, image, command, namespace, and can select deployment (edge/local) using arrow keys.

Example Commands

Cluster Initialization

  • Initialize cluster as server:
    ros2 run ros2_k3s_cli cli init --server
  • Initialize cluster as agent:
    ros2 run ros2_k3s_cli cli init --agent --token <your-token> --url <server-url>

Cluster Resource Management

  • Interactive mode - Browse namespaces, pods, and view logs:

    ros2 run ros2_k3s_cli cli get

    This will:

    1. Show all namespaces and let you select one using arrow keys
    2. Display all pods in the selected namespace in a table format
    3. Let you select a pod using arrow keys
    4. Show the logs from the selected pod (last 5 seconds)
  • Get all namespaces:

    ros2 run ros2_k3s_cli cli get namespace
  • Get pods in a specific namespace:

    ros2 run ros2_k3s_cli cli get pod -n <namespace>

Application Deployment

  • Validate cluster config:
    ros2 run ros2_k3s_cli cli validate --config cluster.yaml
  • Apply (deploy) application:
    ros2 run ros2_k3s_cli cli deploy --config src/ros2-k3s/examples/ros2_sub.yaml

Replace <your-token>, <namespace>, cluster.yaml and the config path with your actual values and configuration files.

Web Dashboard (ros2_k3s_web)

A modern NiceGUI-based dashboard is now available for cluster monitoring:

  • Cluster Overview: View namespaces, nodes, and cluster status in a modern UI
  • Node Status: See real-time node health (Ready/NotReady/Unknown)
  • Namespace Browsing: Click namespaces to view running pods
  • Pod Details: See pod status, container readiness, creation time, and assigned node
  • Resource Monitoring: View live CPU and RAM usage for ready pods; refresh metrics on demand
  • Accurate Pod Health: Pods are only considered healthy if all containers are ready
  • Visual Feedback: Color-coded status, warnings for non-ready pods, and error handling

To run the dashboard:

ros2 run ros2_k3s_web web_app

About

Repo for using k3s with ROS2

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages