From 3c80b4a970a49810261ef8fbd08e0852ee337e9e Mon Sep 17 00:00:00 2001 From: Cyrille Nofficial Date: Tue, 7 Jun 2022 19:11:15 +0200 Subject: [PATCH] feat(k8s): use mqtt service endpoint url closes #1 --- .../roles/microservices/files/robocar/car/deployments.yaml | 5 +---- .../microservices/files/robocar/common/configmap.yaml | 7 ++----- .../microservices/files/robocar/common/endpoints.yaml | 1 + 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/ansible/roles/microservices/files/robocar/car/deployments.yaml b/ansible/roles/microservices/files/robocar/car/deployments.yaml index dbdb4e6..e54c96b 100644 --- a/ansible/roles/microservices/files/robocar/car/deployments.yaml +++ b/ansible/roles/microservices/files/robocar/car/deployments.yaml @@ -117,10 +117,7 @@ spec: mountPath: /dev env: - name: MQTT_BROKER - valueFrom: - configMapKeyRef: - key: MQTT_BROKER_HOST - name: robocar + value: localhost # because use host network - name: MQTT_USERNAME valueFrom: secretKeyRef: diff --git a/ansible/roles/microservices/files/robocar/common/configmap.yaml b/ansible/roles/microservices/files/robocar/common/configmap.yaml index a619260..8c45817 100644 --- a/ansible/roles/microservices/files/robocar/common/configmap.yaml +++ b/ansible/roles/microservices/files/robocar/common/configmap.yaml @@ -4,11 +4,8 @@ metadata: name: robocar data: # Broker configuration - #MQTT_BROKER_HOST: 192.168.217.19 - #MQTT_BROKER: "tcp://192.168.217.19:1883" - MQTT_BROKER_HOST: 192.168.2.221 - MQTT_BROKER: "tcp://192.168.2.221:1883" - #MQTT_BROKER: "tcp://mqtt.robocar.svc.cluster.local:1883" + MQTT_BROKER_HOST: mqtt.robocar.svc.cluster.local + MQTT_BROKER: "tcp://mqtt.robocar.svc.cluster.local:1883" # Camera MQTT_TOPIC_CAMERA: car/satanas/part/camera/camera/color diff --git a/ansible/roles/microservices/files/robocar/common/endpoints.yaml b/ansible/roles/microservices/files/robocar/common/endpoints.yaml index ee12a4d..c3fad01 100644 --- a/ansible/roles/microservices/files/robocar/common/endpoints.yaml +++ b/ansible/roles/microservices/files/robocar/common/endpoints.yaml @@ -8,5 +8,6 @@ metadata: subsets: - addresses: - ip: 192.168.2.221 + # - ip: 192.168.217.19 ports: - port: 1883 \ No newline at end of file