Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
ROS-Kubernetes
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Larkin Heintzman
ROS-Kubernetes
Commits
dc2a3c71
Commit
dc2a3c71
authored
Oct 26, 2021
by
Larkin Heintzman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first custom working ros cluster!
parent
42538d7d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
69 additions
and
67 deletions
+69
-67
Dockerfile
kubernetesPython/hello-python/app/Dockerfile
+0
-9
Dockerfile
llhApproach/docker/node/Dockerfile
+3
-3
bashCheckRoscore.sh
llhApproach/docker/node/bashCheckRoscore.sh
+16
-0
check_roscore.py
llhApproach/docker/node/check_roscore.py
+6
-2
buildRosCluster.yml
llhApproach/kubernetes/buildRosCluster.yml
+0
-0
listener-deployment.yaml
llhApproach/kubernetes/listener-deployment.yaml
+19
-24
master-deployment.yaml
llhApproach/kubernetes/master-deployment.yaml
+2
-2
talker-deployment.yaml
llhApproach/kubernetes/talker-deployment.yaml
+23
-27
No files found.
kubernetesPython/hello-python/app/Dockerfile
deleted
100644 → 0
View file @
42538d7d
FROM
python:3.7
RUN
mkdir
/app
WORKDIR
/app
ADD
. /app/
RUN
pip
install
-r
requirements.txt
EXPOSE
5000
CMD
["python", "/app/main.py"]
llhApproach/docker/node/Dockerfile
View file @
dc2a3c71
...
...
@@ -30,13 +30,13 @@ RUN catkin config \
catkin build
\
roscpp_tutorials
COPY
check_roscore.py /usr/local/bin/check_roscore.py
COPY
bashCheckRoscore.sh /usr/local/bin/bashCheckRoscore.sh
COPY
ros_entrypoint.sh /usr/local/bin/ros_entrypoint.sh
RUN
chmod
755 /usr/local/bin/check_roscore.py
&&
\
chmod
755 /usr/local/bin/ros_entrypoint.sh
RUN
chmod
755 /usr/local/bin/bashCheckRoscore.sh
&&
chmod
755 /usr/local/bin/ros_entrypoint.sh
ENTRYPOINT
["/usr/local/bin/ros_entrypoint.sh"]
# CMD [""]
CMD
["bash"]
# run ros package launch file
...
...
llhApproach/docker/node/bashCheckRoscore.sh
0 → 100755
View file @
dc2a3c71
#!/bin/bash
# set -e
# make sure to source ros work space so we can use the rostopic command
FILE
=
"./resp.txt"
OUT
=
"confirm"
until
[[
$OUT
!=
"confirm"
]]
do
rostopic list &>
$FILE
echo
$OUT
OUT
=
$(
awk
'/ERR/ { print "confirm" }'
$FILE
)
sleep
1
done
echo
"found roscore!"
rm
$FILE
# exit 1
llhApproach/docker/node/check_roscore.py
View file @
dc2a3c71
#!/usr/bin/env python3
import
sys
import
ros
graph
import
ros
py
if
not
rosgraph
.
is_master_online
():
if
rospy
.
is_shutdown
():
print
(
"Waiting roscore ..."
)
sys
.
exit
(
1
)
# if not rosgraph.is_master_online():
# print("Waiting roscore ...")
# sys.exit(1)
print
(
"roscore found!"
)
llhApproach/
docker
/buildRosCluster.yml
→
llhApproach/
kubernetes
/buildRosCluster.yml
View file @
dc2a3c71
File moved
llhApproach/kubernetes/listener-deployment.yaml
View file @
dc2a3c71
...
...
@@ -24,24 +24,22 @@ spec:
# and tries to connect to the rocore which is running in
# a container in the master pod deployment.
# https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
initContainers
:
-
name
:
init-service-listener
image
:
llhcluster
/node:v0
args
:
-
check_roscore.py
env
:
-
name
:
ROS_MASTER_URI
value
:
http://service-master:11311
-
name
:
ROS_HOSTNAME
value
:
service-listener
#
initContainers:
#
- name: init-service-listener
# image: llh
/node:v0
#
args:
# - bashCheckRoscore.sh
#
env:
#
- name: ROS_MASTER_URI
#
value: http://service-master:11311
#
- name: ROS_HOSTNAME
#
value: service-listener
containers
:
# The real node container
-
name
:
llhclusterpublisher
image
:
llhcluster/node:v0
args
:
-
rostopic
-
echo
-
chatter
image
:
llh/node:v0
command
:
[
"
/bin/bash"
]
args
:
[
"
-c"
,
"
source
/opt/ros_ws/devel/setup.bash
&&
/usr/local/bin/bashCheckRoscore.sh
&&
rostopic
echo
/chatter"
]
env
:
-
name
:
ROS_MASTER_URI
value
:
http://service-master:11311
...
...
@@ -55,15 +53,12 @@ spec:
# This is required because the node doesn't fail automatically
# when roscore stops / restarts.
# https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/
livenessProbe
:
exec
:
command
:
-
entrypoint.sh
-
/opt/ros/melodic/bin/rostopic
-
info
-
chatter
initialDelaySeconds
:
5
periodSeconds
:
1
# livenessProbe:
# exec:
# command: ["/bin/bash -c 'ros_entrypoint.sh && rostopic info /chatter'"]
# # args: ["-c", "ros_entrypoint.sh && rostopic info /chatter"]
# initialDelaySeconds: 3
# periodSeconds: 3
---
...
...
llhApproach/kubernetes/master-deployment.yaml
View file @
dc2a3c71
...
...
@@ -20,8 +20,8 @@ spec:
node
:
roscore
spec
:
containers
:
-
name
:
llhclustermaster
image
:
llh
cluster
/master:v0
-
name
:
roscore
image
:
llh/master:v0
args
:
-
roscore
ports
:
...
...
llhApproach/kubernetes/talker-deployment.yaml
View file @
dc2a3c71
...
...
@@ -24,27 +24,22 @@ spec:
# and tries to connect to the rocore which is running in
# a container in the master pod deployment.
# https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
initContainers
:
-
name
:
init-service-talker
image
:
llhcluster
/node:v0
args
:
-
check_roscore.py
env
:
-
name
:
ROS_MASTER_URI
value
:
http://service-master:11311
-
name
:
ROS_HOSTNAME
value
:
service-talker
#
initContainers:
#
- name: init-service-talker
# image: llh
/node:v0
#
args:
# - bashCheckRoscore.sh
#
env:
#
- name: ROS_MASTER_URI
#
value: http://service-master:11311
#
- name: ROS_HOSTNAME
#
value: service-talker
containers
:
# The real node container
-
name
:
llhclusterpublisher
image
:
llhcluster/node:v0
args
:
-
"
rostopic"
-
"
pub"
-
"
-r
1"
-
"
chatter"
-
"
std_msgs/String"
-
"
Hello,
world"
image
:
llh/node:v0
command
:
[
"
/bin/bash"
]
args
:
[
"
-c"
,
"
source
/opt/ros_ws/devel/setup.bash
&&
/usr/local/bin/bashCheckRoscore.sh
&&
rostopic
pub
-r
1
chatter
std_msgs/String
'hello
worl'"
]
env
:
-
name
:
ROS_MASTER_URI
value
:
http://service-master:11311
...
...
@@ -58,15 +53,16 @@ spec:
# This is required because the node doesn't fail automatically
# when roscore stops / restarts.
# https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/
livenessProbe
:
exec
:
command
:
-
entrypoint.sh
-
/opt/ros/melodic/bin/rostopic
-
info
-
chatter
initialDelaySeconds
:
5
periodSeconds
:
1
# livenessProbe:
# exec:
# command: ["/bin/bash -c 'ros_entrypoint.sh && rostopic info /chatter'"]
# # command:
# # - ros_entrypoint.sh
# # - /opt/ros/melodic/bin/rostopic
# # - info
# # - chatter
# initialDelaySeconds: 3
# periodSeconds: 3
---
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment