-
Notifications
You must be signed in to change notification settings - Fork 25
/
ros2-security-sample.yaml
89 lines (87 loc) · 2.53 KB
/
ros2-security-sample.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
apiVersion: apps/v1
kind: Deployment
metadata:
name: ros2-secured-talker
spec:
replicas: 1
selector:
matchLabels:
app: ros2-secured-talker
template:
metadata:
labels:
app: ros2-secured-talker
spec:
containers:
- image: tomoyafujita/ros:rolling
command: ["/bin/bash", "-c"]
# Bind the security environmental variable
envFrom:
- configMapRef:
name: security-env-config
# Start the application with security option
args: ["source /opt/ros/$ROS_DISTRO/setup.bash && ros2 run demo_nodes_cpp talker --ros-args --enclave /talker_listener/talker"]
imagePullPolicy: IfNotPresent
tty: true
name: ros2-secured-talker
# Bind the volume
volumeMounts:
- name: talker-security
mountPath: /etc/demo_keystore/enclaves/talker_listener/talker
# Create volume to bind from ConfigMap
volumes:
- name: talker-security
configMap:
name: talker-enclaves
tolerations:
- key: node-role.kubernetes.io/master
operator: Exists
effect: NoSchedule
- key: node-role.kubernetes.io/control-plane
operator: Exists
effect: NoSchedule
restartPolicy: Always
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ros2-secured-listener
spec:
replicas: 1
selector:
matchLabels:
app: ros2-secured-listener
template:
metadata:
labels:
app: ros2-secured-listener
spec:
containers:
- image: tomoyafujita/ros:rolling
command: ["/bin/bash", "-c"]
# Bind the security environmental variable
envFrom:
- configMapRef:
name: security-env-config
# Start the application with security option
args: ["source /opt/ros/$ROS_DISTRO/setup.bash && ros2 run demo_nodes_cpp listener --ros-args --enclave /talker_listener/listener"]
imagePullPolicy: IfNotPresent
tty: true
name: ros2-secured-listener
# Bind the volume
volumeMounts:
- name: listener-security
mountPath: /etc/demo_keystore/enclaves/talker_listener/listener
# Create volume to bind from ConfigMap
volumes:
- name: listener-security
configMap:
name: listener-enclaves
tolerations:
- key: node-role.kubernetes.io/master
operator: Exists
effect: NoSchedule
- key: node-role.kubernetes.io/control-plane
operator: Exists
effect: NoSchedule
restartPolicy: Always