Compare commits
6 Commits
viva_tech_
...
c6f5f8a185
Author | SHA1 | Date | |
---|---|---|---|
c6f5f8a185 | |||
220162f6f4 | |||
e446025e76 | |||
6759304b25 | |||
3f6ff95dc0 | |||
6562036b05 |
20
ansible/roles/microservices/files/robocar/car/configmap.yaml
Normal file
20
ansible/roles/microservices/files/robocar/car/configmap.yaml
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: robocar-pca9685-pwm
|
||||
data:
|
||||
############################
|
||||
# STEERING PWM - PCA9685 #
|
||||
############################
|
||||
STEERING_PCA9685_LEFT_PWM: "995"
|
||||
STEERING_PCA9685_RIGHT_PWM: "2017"
|
||||
STEERING_PCA9685_CENTER_PWM: "1440"
|
||||
|
||||
###########################
|
||||
# THROTTLE PWM - PCA9685 #
|
||||
############################
|
||||
THROTTLE_PCA9685_MIN_PWM: "994"
|
||||
THROTTLE_PCA9685_MAX_PWM: "1975"
|
||||
THROTTLE_PCA9685_ZERO_PWM: "1420"
|
||||
|
@ -107,6 +107,7 @@ spec:
|
||||
args:
|
||||
- "--image-width=$(CAMERA_WIDTH)"
|
||||
- "--image-height=$(CAMERA_HEIGHT)"
|
||||
- "--objects-threshold=$(THRESHOLD_OBJECTS)"
|
||||
securityContext:
|
||||
runAsUser: 1234
|
||||
privileged: true
|
||||
@ -116,8 +117,10 @@ spec:
|
||||
- name: dev
|
||||
mountPath: /dev
|
||||
env:
|
||||
- name: MQTT_BROKER
|
||||
- name: MQTT_BROKER_HOST
|
||||
value: localhost # because use host network
|
||||
- name: MQTT_BROKER_PORT
|
||||
value: "30183"
|
||||
- name: MQTT_USERNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
@ -135,6 +138,16 @@ spec:
|
||||
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:
|
||||
@ -186,12 +199,13 @@ spec:
|
||||
- "--mqtt-retain=false"
|
||||
- "--throttle-channel=15"
|
||||
- "--steering-channel=14"
|
||||
- "--throttle-zero-pwm=$(THROTTLE_ZERO_PWM)"
|
||||
- "--throttle-min-pwm=$(THROTTLE_MIN_PWM)"
|
||||
- "--throttle-max-pwm=$(THROTTLE_MAX_PWM)"
|
||||
- "--steering-left-pwm=$(STEERING_LEFT_PWM)"
|
||||
- "--steering-right-pwm=$(STEERING_RIGHT_PWM)"
|
||||
- "--steering-center-pwm=$(STEERING_CENTER_PWM)"
|
||||
- "--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:
|
||||
@ -201,6 +215,9 @@ spec:
|
||||
volumeMounts:
|
||||
- mountPath: /dev/i2c-1
|
||||
name: i2c
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: robocar-pca9685-pwm
|
||||
env:
|
||||
- name: MQTT_BROKER
|
||||
valueFrom:
|
||||
@ -231,36 +248,6 @@ spec:
|
||||
name: robocar
|
||||
- name: MQTT_QOS
|
||||
value: "0"
|
||||
- name: STEERING_LEFT_PWM
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: robocar-steering-pwm
|
||||
key: STEERING_LEFT_PWM
|
||||
- name: STEERING_RIGHT_PWM
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: robocar-steering-pwm
|
||||
key: STEERING_RIGHT_PWM
|
||||
- name: STEERING_CENTER_PWM
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: robocar-steering-pwm
|
||||
key: STEERING_CENTER_PWM
|
||||
- name: THROTTLE_MIN_PWM
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: robocar-throttle-pwm
|
||||
key: THROTTLE_MIN_PWM
|
||||
- name: THROTTLE_MAX_PWM
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: robocar-throttle-pwm
|
||||
key: THROTTLE_MAX_PWM
|
||||
- name: THROTTLE_ZERO_PWM
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: robocar-throttle-pwm
|
||||
key: THROTTLE_ZERO_PWM
|
||||
- name: TZ
|
||||
value: "Europe/Paris"
|
||||
volumes:
|
||||
|
@ -7,13 +7,14 @@ namespace: robocar
|
||||
resources:
|
||||
- ../common
|
||||
- deployments.yaml
|
||||
- configmap.yaml
|
||||
|
||||
images:
|
||||
- name: docker.io/cyrilix/robocar-camera
|
||||
newTag: v0.3.0
|
||||
|
||||
- name: docker.io/cyrilix/robocar-pca9685
|
||||
newTag: v0.6.1
|
||||
newTag: v0.6.4
|
||||
|
||||
- name: docker.io/cyrilix/robocar-oak-camera
|
||||
newTag: v0.1.0
|
||||
newTag: v0.2.0
|
@ -4,13 +4,16 @@ metadata:
|
||||
name: robocar
|
||||
data:
|
||||
# Broker configuration
|
||||
MQTT_BROKER_HOST: mqtt.robocar.svc.cluster.local
|
||||
MQTT_BROKER: "tcp://mqtt.robocar.svc.cluster.local:1883"
|
||||
MQTT_BROKER_HOST: nats-server.nats.svc.cluster.local
|
||||
#MQTT_BROKER: "tcp://mqtt.robocar.svc.cluster.local:1883"
|
||||
MQTT_BROKER: "tcp://nats-server.nats.svc.cluster.local:1883"
|
||||
|
||||
# Camera
|
||||
MQTT_TOPIC_CAMERA: car/satanas/part/camera/color
|
||||
MQTT_TOPIC_CAMERA_OAK_COLOR: car/satanas/part/camera/color
|
||||
|
||||
# Objects detection
|
||||
MQTT_TOPIC_OBJECTS: car/satanas/part/objects
|
||||
|
||||
# Radio command
|
||||
MQTT_TOPIC_RC_THROTTLE: car/satanas/part/rc/throttle
|
||||
@ -31,6 +34,9 @@ data:
|
||||
# Records topic
|
||||
MQTT_TOPIC_RECORDS: car/satanas/part/records
|
||||
|
||||
# Feedbacks
|
||||
MQTT_TOPIC_THROTTLE_FEEDBACK: car/satanas/part/feedback/throttle
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
@ -40,8 +46,10 @@ data:
|
||||
############
|
||||
# Throttle #
|
||||
############
|
||||
THROTTLE_MIN: "0.25"
|
||||
THROTTLE_MAX: "0.4"
|
||||
THROTTLE_MIN: "0.2"
|
||||
THROTTLE_MAX: "0.3"
|
||||
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
@ -51,9 +59,17 @@ data:
|
||||
################
|
||||
# STEERING PWM #
|
||||
################
|
||||
STEERING_LEFT_PWM: "1002"
|
||||
STEERING_LEFT_PWM: "1000"
|
||||
STEERING_RIGHT_PWM: "1985"
|
||||
STEERING_CENTER_PWM: "1491"
|
||||
STEERING_CENTER_PWM: "1492"
|
||||
|
||||
############################
|
||||
# STEERING PWM - SECOND RC #
|
||||
############################
|
||||
STEERING_SECONDARY_LEFT_PWM: "1119"
|
||||
STEERING_SECONDARY_RIGHT_PWM: "2141"
|
||||
STEERING_SECONDARY_CENTER_PWM: "1641"
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
@ -63,12 +79,17 @@ data:
|
||||
################
|
||||
# THROTTLE PWM #
|
||||
################
|
||||
#THROTTLE_MIN_PWM: "1092"
|
||||
#THROTTLE_MAX_PWM: "1986"
|
||||
#THROTTLE_ZERO_PWM: "1583"
|
||||
THROTTLE_MIN_PWM: "967"
|
||||
THROTTLE_MAX_PWM: "1966"
|
||||
THROTTLE_ZERO_PWM: "1460"
|
||||
THROTTLE_MIN_PWM: "994"
|
||||
THROTTLE_MAX_PWM: "1979"
|
||||
THROTTLE_ZERO_PWM: "1484"
|
||||
|
||||
###########################
|
||||
# THROTTLE PWM - SECOND RC #
|
||||
############################
|
||||
THROTTLE_SECONDARY_MIN_PWM: "994"
|
||||
THROTTLE_SECONDARY_MAX_PWM: "1975"
|
||||
THROTTLE_SECONDARY_ZERO_PWM: "1506"
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
@ -93,12 +114,16 @@ metadata:
|
||||
name: robocar-models
|
||||
data:
|
||||
# model to use for steering
|
||||
MODEL_STEERING: model_categorical_160x120h0_edgetpu.tflite
|
||||
|
||||
#MODEL_STEERING: model_linear_160x120h40_edgetpu.tflite
|
||||
|
||||
|
||||
#MODEL_STEERING: model_linear_160x120h20_edgetpu.tflite
|
||||
#MODEL_STEERING: model_categorical_160x120h20_edgetpu.tflite
|
||||
MODEL_STEERING: model_linear_160x120h20_edgetpu.tflite
|
||||
MODEL_STEERING5: model_160x120h0_edgetpu.tflite
|
||||
MODEL_STEERING3: model_edgetpu.tflite
|
||||
MODEL_STEERING4: model_160x120h20_edgetpu.tflite
|
||||
MODEL_STEERING2: model-sim-bigimg_edgetpu.tflite
|
||||
|
||||
|
||||
#MODEL_STEERING: model_linear_160x120h50_edgetpu.tflite
|
||||
|
||||
MODEL_IMAGE_WIDTH: "160"
|
||||
MODEL_IMAGE_HEIGHT: "120"
|
||||
@ -111,3 +136,59 @@ metadata:
|
||||
name: robocar-road
|
||||
data:
|
||||
HORIZON: "20"
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: steering
|
||||
data:
|
||||
grid.json: |
|
||||
{
|
||||
"steering_steps": [ -1, -0.66, -0.33, 0, 0.33, 0.66, 1],
|
||||
"distance_steps": [ 0, 0.3, 0.4, 0.5, 0.8, 1],
|
||||
"data": [
|
||||
[ 0, 0, 0, 0, 0, 0],
|
||||
[ 0, 0, 0, 0, 0, 0],
|
||||
[ 0, 0, 0.25, -0.25, 0, 0],
|
||||
[ 0, 0.25, 0.5, -0.5, -0.25, 0],
|
||||
[ 0.25, 0.5, 1, -1, -0.5, -0.25]
|
||||
]
|
||||
}
|
||||
|
||||
"omf.json": |
|
||||
{
|
||||
"steering_steps":[-1, -0.66, -0.33, 0, 0.33, 0.66, 1],
|
||||
"distance_steps": [0, 0.2, 0.4, 0.6, 0.8, 1],
|
||||
"data": [
|
||||
[0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0],
|
||||
[0, 0.25, 0, 0, -0.25, 0],
|
||||
[0.5, 0.25, 0, 0, -0.5, -0.25]
|
||||
]
|
||||
}
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: android
|
||||
data:
|
||||
thresholds.json: |
|
||||
{
|
||||
"threshold_steps": [ 0.07, 0.08, 0.09, 0.1, 0.125, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0 ],
|
||||
"min_valid": 500,
|
||||
"data": [ 8700, 4800, 3500, 2550, 1850, 1387, 992, 840, 750, 700, 655, 620, 590, 570, 553, 549, 548 ]
|
||||
}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: throttle
|
||||
data:
|
||||
brake.json: |
|
||||
{
|
||||
"delta_steps": [ 0.05, 0.3, 0.5 ],
|
||||
"data": [ -0.1, -0.5, -1.0 ]
|
||||
}
|
||||
|
@ -28,14 +28,31 @@ spec:
|
||||
- "--steering-left-pwm=$(STEERING_LEFT_PWM)"
|
||||
- "--steering-right-pwm=$(STEERING_RIGHT_PWM)"
|
||||
- "--steering-center-pwm=$(STEERING_CENTER_PWM)"
|
||||
- "--steering-secondary-left-pwm=$(STEERING_SECONDARY_LEFT_PWM)"
|
||||
- "--steering-secondary-right-pwm=$(STEERING_SECONDARY_RIGHT_PWM)"
|
||||
- "--steering-secondary-center-pwm=$(STEERING_SECONDARY_CENTER_PWM)"
|
||||
- "--throttle-min-pwm=$(THROTTLE_MIN_PWM)"
|
||||
- "--throttle-max-pwm=$(THROTTLE_MAX_PWM)"
|
||||
- "--throttle-center-pwm=$(THROTTLE_ZERO_PWM)"
|
||||
- "--throttle-secondary-min-pwm=$(THROTTLE_SECONDARY_MIN_PWM)"
|
||||
- "--throttle-secondary-max-pwm=$(THROTTLE_SECONDARY_MAX_PWM)"
|
||||
- "--throttle-secondary-center-pwm=$(THROTTLE_SECONDARY_ZERO_PWM)"
|
||||
- '--throttle-feedback-config=/etc/robocar/thresholds.json'
|
||||
- "-log=info"
|
||||
volumeMounts:
|
||||
- mountPath: "/dev/ttyAMA0"
|
||||
name: serial
|
||||
- mountPath: "/etc/robocar"
|
||||
name: robocar
|
||||
securityContext:
|
||||
privileged: true
|
||||
runAsUser: 1234
|
||||
runAsGroup: 20 # Set 20/dialout group to access to serial device
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: robocar-throttle-pwm
|
||||
- configMapRef:
|
||||
name: robocar-steering-pwm
|
||||
env:
|
||||
- name: MQTT_BROKER
|
||||
valueFrom:
|
||||
@ -74,23 +91,13 @@ spec:
|
||||
configMapKeyRef:
|
||||
key: MQTT_TOPIC_RC_SWITCH_RECORD
|
||||
name: robocar
|
||||
- name: MQTT_TOPIC_THROTTLE_FEEDBACK
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: robocar
|
||||
key: MQTT_TOPIC_THROTTLE_FEEDBACK
|
||||
- name: MQTT_QOS
|
||||
value: "0"
|
||||
- name: STEERING_LEFT_PWM
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: robocar-steering-pwm
|
||||
key: STEERING_LEFT_PWM
|
||||
- name: STEERING_RIGHT_PWM
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: robocar-steering-pwm
|
||||
key: STEERING_RIGHT_PWM
|
||||
- name: STEERING_CENTER_PWM
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: robocar-steering-pwm
|
||||
key: STEERING_CENTER_PWM
|
||||
- name: TZ
|
||||
value: "Europe/Paris"
|
||||
volumes:
|
||||
@ -98,6 +105,9 @@ spec:
|
||||
hostPath:
|
||||
path: /dev/ttyAMA0
|
||||
type: CharDevice
|
||||
- name: robocar
|
||||
configMap:
|
||||
name: android
|
||||
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
@ -309,6 +319,13 @@ spec:
|
||||
image: docker.io/cyrilix/robocar-steering
|
||||
args:
|
||||
- "-mqtt-retain=false"
|
||||
- "--image-width=$(IMAGE_WIDTH)"
|
||||
- "--image-height=$(IMAGE_HEIGHT)"
|
||||
- "--enable-objects-correction=true"
|
||||
- "--enable-objects-correction-user=false"
|
||||
- "--grid-map-config=/etc/robocar/grid.json"
|
||||
- "--objects-move-factors-config=/etc/robocar/omf.json"
|
||||
- "--delta-middle=0.1"
|
||||
- "-log=info"
|
||||
securityContext:
|
||||
runAsUser: 1234
|
||||
@ -351,10 +368,32 @@ spec:
|
||||
configMapKeyRef:
|
||||
key: MQTT_TOPIC_RC_DRIVE_MODE
|
||||
name: robocar
|
||||
- name: MQTT_TOPIC_OBJECTS
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: MQTT_TOPIC_OBJECTS
|
||||
name: robocar
|
||||
- name: MQTT_QOS
|
||||
value: "0"
|
||||
- name: IMAGE_WIDTH
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: CAMERA_WIDTH
|
||||
name: robocar-camera
|
||||
- name: IMAGE_HEIGHT
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: CAMERA_HEIGHT
|
||||
name: robocar-camera
|
||||
- name: TZ
|
||||
value: "Europe/Paris"
|
||||
volumeMounts:
|
||||
- mountPath: /etc/robocar
|
||||
name: robocar-configs
|
||||
volumes:
|
||||
- name: robocar-configs
|
||||
configMap:
|
||||
name: steering
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
@ -379,8 +418,10 @@ spec:
|
||||
- name: throttle
|
||||
image: docker.io/cyrilix/robocar-throttle
|
||||
args:
|
||||
- "-mqtt-retain=false"
|
||||
- "-debug=false"
|
||||
- "--mqtt-retain=false"
|
||||
- "--enable-brake-feature=true"
|
||||
- "--brake-configuration=/etc/robocar/brake.json"
|
||||
- "--log=info"
|
||||
securityContext:
|
||||
runAsUser: 1234
|
||||
runAsGroup: 1234
|
||||
@ -417,6 +458,16 @@ spec:
|
||||
configMapKeyRef:
|
||||
key: MQTT_TOPIC_RC_DRIVE_MODE
|
||||
name: robocar
|
||||
- name: MQTT_TOPIC_THROTTLE_FEEDBACK
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: robocar
|
||||
key: MQTT_TOPIC_THROTTLE_FEEDBACK
|
||||
- name: MQTT_TOPIC_STEERING
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: MQTT_TOPIC_STEERING
|
||||
name: robocar
|
||||
- name: THROTTLE_MIN
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
@ -431,6 +482,13 @@ spec:
|
||||
value: "0"
|
||||
- name: TZ
|
||||
value: "Europe/Paris"
|
||||
volumeMounts:
|
||||
- mountPath: /etc/robocar
|
||||
name: throttle-config
|
||||
volumes:
|
||||
- name: throttle-config
|
||||
configMap:
|
||||
name: throttle
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
|
@ -1,13 +0,0 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Endpoints
|
||||
metadata:
|
||||
name: mqtt
|
||||
labels:
|
||||
app: mqtt
|
||||
subsets:
|
||||
- addresses:
|
||||
- ip: 192.168.2.221
|
||||
# - ip: 192.168.217.19
|
||||
ports:
|
||||
- port: 1883
|
@ -4,22 +4,21 @@ kind: Kustomization
|
||||
|
||||
resources:
|
||||
- deployments.yaml
|
||||
- endpoints.yaml
|
||||
- services.yaml
|
||||
- configmap.yaml
|
||||
|
||||
images:
|
||||
- name: docker.io/cyrilix/robocar-arduino
|
||||
newTag: v0.7.1
|
||||
newTag: v0.9.0
|
||||
|
||||
- name: docker.io/cyrilix/robocar-led
|
||||
newTag: v0.5.1
|
||||
|
||||
- name: docker.io/cyrilix/robocar-steering-tflite-edgetpu
|
||||
newTag: v0.5.0
|
||||
newTag: v0.5.3
|
||||
|
||||
- name: docker.io/cyrilix/robocar-throttle
|
||||
newTag: v0.4.2
|
||||
newTag: v0.6.0
|
||||
|
||||
- name: docker.io/cyrilix/robocar-record
|
||||
newTag: v0.5.1
|
||||
@ -28,7 +27,7 @@ images:
|
||||
newTag: v0.2.1
|
||||
|
||||
- name: docker.io/cyrilix/robocar-steering
|
||||
newTag: v0.5.1
|
||||
newTag: v0.6.0
|
||||
|
||||
- name: docker.io/cyrilix/robocar-road
|
||||
newTag: v0.2.0
|
||||
|
@ -0,0 +1,18 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: nats
|
||||
data:
|
||||
standalone.conf: |
|
||||
server_name: nats
|
||||
http: 0.0.0.0:8222
|
||||
jetstream {
|
||||
store_dir: /data/datastore
|
||||
}
|
||||
mqtt {
|
||||
listen: 0.0.0.0:1883
|
||||
}
|
||||
authorization: {
|
||||
user: satanas,
|
||||
password: satanas
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
namespace: nats
|
||||
|
||||
resources:
|
||||
- namespace.yaml
|
||||
- serviceaccount.yaml
|
||||
- configmaps.yaml
|
||||
- statefulset.yaml
|
||||
- services.yaml
|
@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: nats
|
@ -0,0 +1,5 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: nats-server
|
||||
automountServiceAccountToken: false
|
41
ansible/roles/microservices/files/robocar/nats/services.yaml
Normal file
41
ansible/roles/microservices/files/robocar/nats/services.yaml
Normal file
@ -0,0 +1,41 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: nats-server-ext
|
||||
spec:
|
||||
type: NodePort
|
||||
ports:
|
||||
- port: 4222
|
||||
name: tcp-nats-client
|
||||
targetPort: tcp-nats-client
|
||||
nodePort: 30422
|
||||
- name: http-monitoring
|
||||
port: 8222
|
||||
targetPort: http-monitoring
|
||||
nodePort: 30822
|
||||
- name: tcp-mqtt
|
||||
port: 1883
|
||||
targetPort: tcp-mqtt
|
||||
nodePort: 30183
|
||||
selector:
|
||||
appli: nats-server
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: nats-server
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 4222
|
||||
name: tcp-nats-client
|
||||
targetPort: tcp-nats-client
|
||||
- name: http-monitoring
|
||||
port: 8222
|
||||
targetPort: http-monitoring
|
||||
- name: tcp-mqtt
|
||||
port: 1883
|
||||
targetPort: tcp-mqtt
|
||||
selector:
|
||||
appli: nats-server
|
@ -0,0 +1,58 @@
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: nats-server
|
||||
annotations:
|
||||
reloader.stakater.com/auto: "true"
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
appli: nats-server
|
||||
serviceName: nats
|
||||
replicas: 1
|
||||
revisionHistoryLimit: 0
|
||||
template:
|
||||
metadata:
|
||||
name: nats-server
|
||||
labels:
|
||||
appli: nats-server
|
||||
spec:
|
||||
serviceAccountName: nats-server
|
||||
containers:
|
||||
- name: nats-server
|
||||
image: docker.io/library/nats:latest
|
||||
args:
|
||||
- --http_port=8222
|
||||
- --config=/etc/nats/standalone.conf
|
||||
ports:
|
||||
- containerPort: 4222
|
||||
name: tcp-nats-client
|
||||
- name: http-monitoring
|
||||
containerPort: 8222
|
||||
- name: tcp-mqtt
|
||||
containerPort: 1883
|
||||
volumeMounts:
|
||||
- mountPath: /etc/nats
|
||||
name: nats-config
|
||||
- name: nats-data
|
||||
mountPath: /data
|
||||
securityContext:
|
||||
runAsUser: 1234
|
||||
runAsGroup: 1234
|
||||
fsGroup: 1234
|
||||
fsGroupChangePolicy: Always
|
||||
volumes:
|
||||
- name: nats-config
|
||||
configMap:
|
||||
name: nats
|
||||
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: nats-data
|
||||
spec:
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
storageClassName: local-path
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
Reference in New Issue
Block a user