Scalable Software Delivery for Your DDS Systems - Part 2 of 2
Last week in Part 1, I provided an overview of Kubernetes (k8s) and explained how it can improve software delivery in large-scale DDS systems. Today in Part 2, I would like to go through detailed instructions on how to deploy Data Distribution Service™ (DDS) applications on k8s for you to use as reference. Let’s get started!
Checklist to Deploy DDS Applications on Kubernetes
To deploy DDS applications on k8s, you’ll first need to complete the following steps:
- Develop a build file for a Docker image.
- Build a Docker image and push it to a Docker repository.
- Develop k8s manifest files.
- Deploy containers with the k8s manifest files.
I will now walk you through each of these steps using RTI Perftest as an example DDS application (see Figure 1). We’ll assume you already have your own k8s cluster and kubectl (that can access the cluster) installed on your machine. k8s integrates multiple virtual networking solutions such as Calico, Flannel and WeaveNet as plugins and you only need to pick one of them. I picked WeaveNet because it supports multicast and therefore I did not need to configure anything for DDS discovery.
If you use other networking solutions that do not support multicast, such as Calico and Flannel, you should run Cloud Discovery Service (CDS). CDS is our experimental product that handles discovery over networks that do not offer support for multicast capabilities.

Figure 1. Kubernetes Networking Under the Hood
Step 1. Develop a build file for Docker image
FROM ubuntu:18.04 as builder
RUN apt-get update \ && apt-get install -y wget
RUN mkdir /build && cd /build \ && wget https://github.com/rticommunity/rtiperftest/releases/download/3.0.1/rti_perftest-3.0.1_connext_dds_pro_6.0.0_x64Linux.tar.gz \ && tar xvfz rti_perftest-3.0.1_connext_dds_pro_6.0.0_x64Linux.tar.gz
WORKDIR /build
FROM ubuntu:18.04
ENV perftest_args=
COPY --from=builder /build/rti_perftest-3.0.1_x64Linux3gcc4.8.2/perftest_qos_profiles.xml /app/perftest_qos_profiles.xml
COPY --from=builder /build/rti_perftest-3.0.1_x64Linux3gcc4.8.2/bin/x64Linux3gcc4.8.2/release/perftest_cpp /app/perftest_cpp
WORKDIR /app
CMD ./perftest_cpp ${perftest_args}
|
Dockerfile for RTI Perftest
Step 2. Build a Docker image and push it to a Docker repository
Run the following command to build a Docker image for RTI Perftest.
$ docker build -t DOCKER_REGISTRY_URL/rti-perftest:v3.0.1 .
After that, you can push the build image to a Docker repository.
$ docker push DOCKER_REGISTRY_URL/rti-perftest:v3.0.1
The pushed Docker image should be accessible by your k8s worker nodes.
Step 3. Develop k8s manifest files
Next, Kubernetes manifest files for RTI Perftest publisher and subscriber need to be developed.
--- apiVersion: "apps/v1" kind: "Deployment" metadata: name: "rtiperftest-pub" namespace: "default" labels: app: "rtiperftest-pub" spec: replicas: 1 selector: matchLabels: app: "rtiperftest-pub" template: metadata: labels: app: "rtiperftest-pub" spec: containers: - name: "rtiperftest-pub" image: "kyoungho/rti-perftest:v3.0.1" env: - name: "perftest_args" value: "-pub" |
Kubernetes Manifest for RTI Perftest Publisher (rtiperftest_pub.yaml)
--- apiVersion: "apps/v1" kind: "Deployment" metadata: name: "rtiperftest-sub" namespace: "default" labels: app: "rtiperftest-sub" spec: replicas: 1 selector: matchLabels: app: "rtiperftest-sub" template: metadata: labels: app: "rtiperftest-sub" spec: containers: - name: "rtiperftest-sub" image: "kyoungho/rti-perftest:v3.0.1" env: - name: "perftest_args" value: "-sub" |
Kubernetes Manifest for RTI Perftest Subscriber (rtiperftest_sub.yaml)
Step 4. Deploy containers with the manifest files and scale them up
The last step is to deploy containers with the manifest files via kubectl.
$ kubectl apply -f rtiperftest_pub.yaml
$ kubectl apply -f rtiperftest_sub.yaml
After running the commands, you can check if they are successfully deployed and running.
$ kubectl get pods
You should see something like this:
NAME |
READY |
STATUS |
RESTARTS |
AGE |
rtiperftest-pub-6b56f4cc86-ds88h |
1/1 |
Running |
0 |
32s |
rtiperftest-sub-8549bc57bf-n7wnf |
1/1 |
Running |
0 |
10s |
Once the pods are running, you can get the logs of a specific pod.
$ kubectl logs rtiperftest-sub-8549bc57bf-n7wnf
RTI Perftest 3.0.1 (RTI Connext DDS 6.0.0)
You can simply scale up the subscriber by running the following command.
$ kubectl scale -replica=3 deployment/rtiperftest-sub
Conclusion
k8s can simplify remote deployment and scaling of applications with declarative manifests. I did not demonstrate it here, but k8s can self-heal by automatically spinning up pods on healthy nodes when they fail and can also remotely perform rolling updates and rollbacks.
DDS works pretty well for pod-to-pod communications inside a k8s cluster. If you use a networking plugin supporting multicast, DDS can automatically handle discovery for your applications without relying on a stable IP address and DNS name provided by a k8s Service.
However, there are still some questions you may have when deploying DDS applications on Kubernetes, such as:
- How can we expose DDS communications outside of a k8s cluster?
- What is the performance overhead over k8s virtual networks?
- How can we replicate stateful DDS applications?
I also had these questions while exploring k8s. The good news: I will share what I learned about these topics with you in the near future. Stay tuned!
See also:
Part 1: Kubernetes Explained: How It Can Improve Software Delivery in Large-Scale DDS Systems
About the author
Kyoungho An is a Senior Research Engineer at Real-Time Innovations (RTI). He has 10 years of experience with distributed real-time embedded systems. His research interest includes publish/subscribe middleware, and deployment and monitoring of distributed systems. He has been leading several DOD and DOE funded research projects as a principal investigator. He has published research papers in journals and conferences focusing on distributed event-based systems, middleware, and cyber-physical systems. He holds a Ph.D. in Computer Science from Vanderbilt University.