258 lines
7.2 KiB
YAML
258 lines
7.2 KiB
YAML
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: camera
|
|
annotations:
|
|
reloader.stakater.com/auto: "true"
|
|
spec:
|
|
revisionHistoryLimit: 0
|
|
replicas: 0
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
component: camera
|
|
template:
|
|
metadata:
|
|
labels:
|
|
component: camera
|
|
spec:
|
|
containers:
|
|
- name: camera
|
|
image: docker.io/cyrilix/robocar-camera
|
|
args:
|
|
- "-mqtt-pub-frequency=$(MQTT_CAMERA_PUB_FREQUENCY)"
|
|
- "-video-device=0"
|
|
- "-video-width=$(CAMERA_WIDTH)"
|
|
- "-video-height=$(CAMERA_HEIGHT)"
|
|
- "-log=info"
|
|
securityContext:
|
|
runAsUser: 1234
|
|
runAsGroup: 44 # Set 44/video group to access to video device
|
|
privileged: true
|
|
volumeMounts:
|
|
- name: camera-device
|
|
mountPath: /dev/video0
|
|
env:
|
|
- name: MQTT_BROKER
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
key: MQTT_BROKER
|
|
name: robocar
|
|
- name: MQTT_USERNAME
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: MQTT_USERNAME
|
|
name: mqtt-credentials
|
|
- name: MQTT_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: MQTT_PASSWORD
|
|
name: mqtt-credentials
|
|
- name: MQTT_CLIENT_ID
|
|
value: rc-camera
|
|
- name: MQTT_TOPIC
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
key: MQTT_TOPIC_CAMERA
|
|
name: robocar
|
|
- name: CAMERA_WIDTH
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
key: CAMERA_WIDTH
|
|
name: robocar-camera
|
|
- name: CAMERA_HEIGHT
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
key: CAMERA_HEIGHT
|
|
name: robocar-camera
|
|
- name: MQTT_CAMERA_PUB_FREQUENCY
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
key: MQTT_CAMERA_PUB_FREQUENCY
|
|
name: robocar-camera
|
|
- name: MQTT_QOS
|
|
value: "0"
|
|
- name: TZ
|
|
value: "Europe/Paris"
|
|
volumes:
|
|
- name: camera-device
|
|
hostPath:
|
|
path: "/dev/video0"
|
|
type: CharDevice
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: oak-camera
|
|
annotations:
|
|
reloader.stakater.com/auto: "true"
|
|
spec:
|
|
revisionHistoryLimit: 0
|
|
replicas: 1
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
component: oak-camera
|
|
template:
|
|
metadata:
|
|
labels:
|
|
component: oak-camera
|
|
spec:
|
|
containers:
|
|
- name: camera
|
|
image: docker.io/cyrilix/robocar-oak-camera
|
|
args:
|
|
- "--image-width=$(CAMERA_WIDTH)"
|
|
- "--image-height=$(CAMERA_HEIGHT)"
|
|
- "--objects-threshold=$(THRESHOLD_OBJECTS)"
|
|
securityContext:
|
|
runAsUser: 1234
|
|
privileged: true
|
|
volumeMounts:
|
|
- name: sys
|
|
mountPath: /sys
|
|
- name: dev
|
|
mountPath: /dev
|
|
env:
|
|
- name: MQTT_BROKER_HOST
|
|
value: localhost # because use host network
|
|
- name: MQTT_BROKER_PORT
|
|
value: "30183"
|
|
- name: MQTT_USERNAME
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: MQTT_USERNAME
|
|
name: mqtt-credentials
|
|
- name: MQTT_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: MQTT_PASSWORD
|
|
name: mqtt-credentials
|
|
- name: MQTT_CLIENT_ID
|
|
value: rc-oak-camera
|
|
- name: MQTT_TOPIC_CAMERA
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
key: MQTT_TOPIC_CAMERA_OAK_COLOR
|
|
name: robocar
|
|
- name: MQTT_TOPIC_OBJECTS
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
key: MQTT_TOPIC_OBJECTS
|
|
name: robocar
|
|
- name: THRESHOLD_OBJECTS
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
key: THRESHOLD
|
|
name: robocar-objects
|
|
- name: CAMERA_WIDTH
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
key: CAMERA_WIDTH
|
|
name: robocar-camera
|
|
- name: CAMERA_HEIGHT
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
key: CAMERA_HEIGHT
|
|
name: robocar-camera
|
|
- name: MQTT_QOS
|
|
value: "0"
|
|
- name: TZ
|
|
value: "Europe/Paris"
|
|
hostNetwork: true
|
|
volumes:
|
|
- name: sys
|
|
hostPath:
|
|
path: /sys
|
|
- name: dev
|
|
hostPath:
|
|
path: "/dev"
|
|
|
|
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: pca9685
|
|
annotations:
|
|
reloader.stakater.com/auto: "true"
|
|
spec:
|
|
revisionHistoryLimit: 0
|
|
replicas: 1
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
component: pca9685
|
|
template:
|
|
metadata:
|
|
labels:
|
|
component: pca9685
|
|
spec:
|
|
containers:
|
|
- name: pca9685
|
|
image: docker.io/cyrilix/robocar-pca9685
|
|
args:
|
|
- "--mqtt-retain=false"
|
|
- "--throttle-channel=15"
|
|
- "--steering-channel=14"
|
|
- "--throttle-zero-pwm=$(THROTTLE_PCA9685_ZERO_PWM)"
|
|
- "--throttle-min-pwm=$(THROTTLE_PCA9685_MIN_PWM)"
|
|
- "--throttle-max-pwm=$(THROTTLE_PCA9685_MAX_PWM)"
|
|
- "--steering-left-pwm=$(STEERING_PCA9685_LEFT_PWM)"
|
|
- "--steering-right-pwm=$(STEERING_PCA9685_RIGHT_PWM)"
|
|
- "--steering-center-pwm=$(STEERING_PCA9685_CENTER_PWM)"
|
|
- "--pwm-freq=50"
|
|
- "--update-pwm-frequency=25"
|
|
- "--log=info"
|
|
securityContext:
|
|
runAsUser: 1234
|
|
runAsGroup: 998 # Set 998/i2c group to access to i2c device
|
|
privileged: true
|
|
volumeMounts:
|
|
- mountPath: /dev/i2c-1
|
|
name: i2c
|
|
envFrom:
|
|
- configMapRef:
|
|
name: robocar-pca9685-pwm
|
|
env:
|
|
- name: MQTT_BROKER
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
key: MQTT_BROKER
|
|
name: robocar
|
|
- name: MQTT_USERNAME
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: MQTT_USERNAME
|
|
name: mqtt-credentials
|
|
- name: MQTT_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: MQTT_PASSWORD
|
|
name: mqtt-credentials
|
|
- name: MQTT_CLIENT_ID
|
|
value: rc-pca9685
|
|
- name: MQTT_TOPIC_THROTTLE
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
key: MQTT_TOPIC_THROTTLE
|
|
name: robocar
|
|
- name: MQTT_TOPIC_STEERING
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
key: MQTT_TOPIC_STEERING
|
|
name: robocar
|
|
- name: MQTT_QOS
|
|
value: "0"
|
|
- name: TZ
|
|
value: "Europe/Paris"
|
|
volumes:
|
|
- name: i2c
|
|
hostPath:
|
|
path: /dev/i2c-1
|
|
type: CharDevice
|