fujitatomoya / ros_k8s

Kuberenetes / ROS&ROS2 Cluster Samples
Creative Commons Attribution 4.0 International
194 stars 30 forks source link

Support KubeEdge tutorial with far edge micro-ROS #3

Open fujitatomoya opened 1 year ago

fujitatomoya commented 1 year ago

tutorial goes with https://kubeedge.io.

KubeEdge can good performance advantage to connect edge devices to Kubernetes Cluster running in the cloud infrastructure. This tutorial does not include far edge micro-ROS device, but using host network interface to connect near edge devices running ROS 2 in the same network could be really useful example.

fujitatomoya commented 1 year ago

related to https://github.com/fujitatomoya/ros_k8s/issues/9,

probably when developing the example for this, I can also bind edgemesh provided by https://github.com/kubeedge/edgemesh for network interface.

a732264856 commented 1 year ago

Hello,Can you tell me what changes need to be made on the deployment file to support Edgemesh, I tried this but failed, the talker node on the side could not connect to the rosmaster node on the cloud. (They are not in the same LAN.) pod service erroor

a732264856 commented 1 year ago

This is the content of the delpoyment file used, only the roscore service content has been modified based on your previous offer

############################

ROS master / roscore

############################

apiVersion: apps/v1 kind: Deployment metadata: name: roscore-deployment labels: app: ros1 node: roscore spec: replicas: 1 selector: matchLabels: node: roscore template: metadata: labels: node: roscore spec: containers:


Headless service declaration.

This is required to map to app roscore so that other pods can DNS rosmaster IP address dynamically.

apiVersion: v1 kind: Service metadata: name: rosmaster labels: app: ros1 node: roscore spec:

clusterIP: None

ports:


##################

ROS talker

##################

apiVersion: apps/v1 kind: Deployment metadata: name: talker-deployment labels: app: ros1 node: talker spec: replicas: 1 selector: matchLabels: node: talker template: metadata: labels: node: talker spec: containers:


Headless service declaration.

This is required to map to app publisher so that other pods can DNS IP address dynamically.

apiVersion: v1 kind: Service metadata: name: ros-talker labels: app: ros1 node: talker spec: clusterIP: None selector: node: talker


####################

ROS listener

####################

apiVersion: apps/v1 kind: Deployment metadata: name: listener-deployment labels: app: ros1 node: listener spec: replicas: 1 selector: matchLabels: node: listener template: metadata: labels: node: listener spec: containers:


Headless service declaration.

This is required to map to app subscription so that other pods can DNS IP address dynamically.

apiVersion: v1 kind: Service metadata: name: ros-listener labels: app: ros1 node: listener spec: clusterIP: None
selector: node: listener

fujitatomoya commented 1 year ago

unfortunately, i have not tried this configuration yet.

off the top of my head, i would try,

a732264856 commented 1 year ago

I used KubeEdge and EdgeMesh. Now I encountered a very strange situation. After I exposed port 11311 of ros_master, EdgeMesh could not access it. It was accessible the first time I used it, and then it wasn't, but I didn't make any changes 1679663814082 1679663860901

fujitatomoya commented 1 year ago

@a732264856 appreciate the information. this issue was meant to use KubeEdge with host network and connect micro-ROS devices as far edge devices. I would not probably use EdgeMesh at this moment. but that is really interesting and i need to catch up with it.

fujitatomoya commented 1 year ago

image

fujitatomoya commented 1 year ago

image