fujitatomoya / ros_k8s

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

fix: disable default CNI #16

Closed wep21 closed 1 year ago

wep21 commented 1 year ago

I need to disable default CNI to make ros2-sample works correctly in kind environment. I have tested with the following procedure.

# create kind cluster
kind create cluster --name test --config yaml/kind-multiple-node.yaml
# enable weavenet daemonset
kubectl apply -f https://github.com/weaveworks/weave/releases/download/v2.8.1/weave-daemonset-k8s-1.11.yaml
# enable ros2 sample
kubectl apply -f https://raw.githubusercontent.com/fujitatomoya/ros_k8s/master/yaml/ros2-sample.yaml
# topic echo
❯ kubectl exec --stdin --tty ros2-listener-1-5d89b7dff7-7q6mh -- /bin/bash
root@ros2-listener-1-5d89b7dff7-7q6mh:/# source /opt/ros/rolling/setup.bash 
root@ros2-listener-1-5d89b7dff7-7q6mh:/# ros2 topic list
/chatter1
/chatter2
/chatter3
/parameter_events
/rosout
root@ros2-listener-1-5d89b7dff7-7q6mh:/# ros2 topic echo /chatter1
data: Hello, I am talker-1
---
data: Hello, I am talker-1
---
data: Hello, I am talker-1
---

Before disabling default CNI, the output was

root@ros2-listener-1-5d89b7dff7-v82br:/# source opt/ros/rolling/setup.bash
root@ros2-listener-1-5d89b7dff7-v82br:/# ros2 topic list
/chatter1
/parameter_events
/rosout
root@ros2-listener-1-5d89b7dff7-v82br:/# ros2 topic echo /chatter1

(/chatter1 is visible because ros2-listener-1 pod is subscribing it.)

wep21 commented 1 year ago

@fujitatomoya Could you review this PR, please?

fujitatomoya commented 1 year ago

@wep21 yeah right this is not what is expected here, https://kind.sigs.k8s.io/docs/user/configuration/#disable-default-cni. we do not need to start kindnet by default.