ROS 2 Fast-DDS Discovery Server with Kubernetes

Hi ROS 2 developers and users,

As I had the presentation about ROS / ROS 2 with Kubernetes and KubeEdge at ROSCon 2023, I have been working to put together tutorials and operation how to deploy and manage the ROS / ROS 2 fleet using Kubernetes with sample yaml description and tutorials including installation, building multi-arch container images and Kubernetes deployment.

I would like to share a couple of updates.

ROS 2 Zero Copy Data Sharing in kubernetes/pods

Even our application is running in the Kubernetes pods, we can still take advantage of ROS 2 LoanedMessage and Fast-DDS Data Sharing Delivery between the different container images in the same pod.
This brings significant performance improvement for our application as Kubernetes deployment.

see more details for ROS 2 Zero Copy Data Sharing Kubernetes Yaml.

ROS 2 Fast-DDS Discovery Server Dynamic DNS

When we use Kubernetes to manage our robot application, there could be many ROS 2 application (a.k.a ROS 2 context/DDS Participant) exist in the ROS 2 network. This could be discovery cost and performance problem sometimes.
For this situation, we can use ROS 2 Fast-DDS Discovery Server to reduce the discovery cost significantly, but this generates static centralized configuration for ROS 2 applications. in other word, we need to set the discovery server IP address before application starts. With Kubernetes, things could be much more complicated since Cluster IP address will be assigned when application container starts running. So we cannot know the IP address assigned to discovery server until it is deployed.

The one of the solution is Headless Service, that allows us to DNS the discovery server dynamically from the other application in the cluster. So as long as server is running somewhere in the cluster, other ROS 2 application can DNS the server dynamically when the container starts.

see more details for ROS 2 Fast-DDS Discovery Server with Headless Service and ROS 2 Application Deployment

there are still interesting topics, so if you are interested please feel free to reach out to here.

Best,
Tomoya

8 Likes