From 3fcd5dce4080c279d4e32bd759d7016cafb40708 Mon Sep 17 00:00:00 2001 From: Bryon Nevis Date: Wed, 31 May 2023 15:20:27 -0700 Subject: [PATCH] feat: Helm updates to device-coap and device-bacnet for v3 C SDK Signed-off-by: Bryon Nevis --- .../edgex-device-c-sdk-environment.yaml | 31 +++++++++++++++++++ .../edgex-device-bacnet-deployment.yaml | 3 +- .../edgex-device-coap-deployment.yaml | 3 +- deployment/helm/values.yaml | 6 ++-- 4 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 deployment/helm/templates/configmaps/edgex-device-c-sdk-environment.yaml diff --git a/deployment/helm/templates/configmaps/edgex-device-c-sdk-environment.yaml b/deployment/helm/templates/configmaps/edgex-device-c-sdk-environment.yaml new file mode 100644 index 00000000..da11058b --- /dev/null +++ b/deployment/helm/templates/configmaps/edgex-device-c-sdk-environment.yaml @@ -0,0 +1,31 @@ +# Copyright (C) 2022 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 +# + +# C SDK in EdgeX 3.0 does not yet support common config; +# Use env var override for what is normally in common config + +apiVersion: v1 +kind: ConfigMap +metadata: + name: edgex-device-c-sdk-environment +data: + CLIENTS_CORE_METADATA_HOST: edgex-core-metadata + DATABASE_HOST: edgex-redis + REGISTRY_HOST: edgex-core-consul +{{- if (eq .Values.edgex.features.messagebusbackend "redis") }} + MESSAGEBUS_HOST: edgex-redis +{{- end }} +{{- if (eq .Values.edgex.features.messagebusbackend "mqtt") }} + MESSAGEBUS_TYPE: mqtt + MESSAGEBUS_PROTOCOL: tcp + MESSAGEBUS_HOST: edgex-mqtt-broker + MESSAGEBUS_PORT: "1883" +{{- end }} +{{- if .Values.edgex.security.enabled }} + MESSAGEBUS_AUTHMODE: usernamepassword + MESSAGEBUS_SECRETNAME: message-bus +{{- else }} + MESSAGEBUS_AUTHMODE: none +{{- end }} diff --git a/deployment/helm/templates/edgex-device-bacnet/edgex-device-bacnet-deployment.yaml b/deployment/helm/templates/edgex-device-bacnet/edgex-device-bacnet-deployment.yaml index 074bdfe5..4d714500 100644 --- a/deployment/helm/templates/edgex-device-bacnet/edgex-device-bacnet-deployment.yaml +++ b/deployment/helm/templates/edgex-device-bacnet/edgex-device-bacnet-deployment.yaml @@ -46,7 +46,6 @@ spec: - "/device-bacnet-ip/device-bacnet-c" - "-cp=consul://edgex-core-consul:8500" - "--registry" - - "--confdir=/res" {{- end}} ports: - containerPort: {{.Values.edgex.port.device.bacnet}} @@ -63,6 +62,8 @@ spec: envFrom: - configMapRef: name: edgex-common-variables + - configMapRef: + name: edgex-device-c-sdk-environment securityContext: allowPrivilegeEscalation: false readOnlyRootFilesystem: true diff --git a/deployment/helm/templates/edgex-device-coap/edgex-device-coap-deployment.yaml b/deployment/helm/templates/edgex-device-coap/edgex-device-coap-deployment.yaml index 0a53bc15..079c750b 100644 --- a/deployment/helm/templates/edgex-device-coap/edgex-device-coap-deployment.yaml +++ b/deployment/helm/templates/edgex-device-coap/edgex-device-coap-deployment.yaml @@ -46,7 +46,6 @@ spec: - "/device-coap" - "-cp=consul://edgex-core-consul:8500" - "--registry" - - "--confdir=/res" {{- end}} ports: - containerPort: {{.Values.edgex.port.device.coap}} @@ -63,6 +62,8 @@ spec: envFrom: - configMapRef: name: edgex-common-variables + - configMapRef: + name: edgex-device-c-sdk-environment securityContext: allowPrivilegeEscalation: false readOnlyRootFilesystem: true diff --git a/deployment/helm/values.yaml b/deployment/helm/values.yaml index 469fa732..70673cc8 100644 --- a/deployment/helm/values.yaml +++ b/deployment/helm/values.yaml @@ -340,9 +340,9 @@ edgex: runAsUser: 2002 runAsGroup: 2001 tlsHost: edgex - addConsulRoles: "app-external-mqtt-trigger,app-http-export,app-metrics-influxdb,app-mqtt-export,app-rfid-llrp-inventory,app-sample,device-bacnet,device-coap,device-gpio,device-modbus,device-mqtt,device-onvif-camera,device-rfid-llrp,device-snmp,device-usb-camera" - addServiceTokens: "app-external-mqtt-trigger,app-http-export,app-metrics-influxdb,app-mqtt-export,app-rfid-llrp-inventory,app-sample,device-bacnet,device-coap,device-gpio,device-modbus,device-mqtt,device-onvif-camera,device-rest,device-rfid-llrp,device-snmp,device-usb-camera,device-virtual" - addKnownSecrets: "redisdb[app-external-mqtt-trigger;app-http-export;app-metrics-influxdb;app-mqtt-export;app-rfid-llrp-inventory;app-sample;device-bacnet;device-coap;device-gpio;device-modbus;device-mqtt;device-onvif-camera;device-rest;device-rfid-llrp;device-snmp;device-usb-camera;device-virtual],message-bus[app-external-mqtt-trigger;app-http-export;app-metrics-influxdb;app-mqtt-export;app-rfid-llrp-inventory;app-sample;device-bacnet;device-coap;device-gpio;device-modbus;device-mqtt;device-onvif-camera;device-rest;device-rfid-llrp;device-snmp;device-usb-camera;device-virtual]" + addConsulRoles: "app-external-mqtt-trigger,app-http-export,app-metrics-influxdb,app-mqtt-export,app-rfid-llrp-inventory,app-sample,device-bacnet-ip,device-coap,device-gpio,device-modbus,device-mqtt,device-onvif-camera,device-rfid-llrp,device-snmp,device-usb-camera" + addServiceTokens: "app-external-mqtt-trigger,app-http-export,app-metrics-influxdb,app-mqtt-export,app-rfid-llrp-inventory,app-sample,device-bacnet-ip,device-coap,device-gpio,device-modbus,device-mqtt,device-onvif-camera,device-rest,device-rfid-llrp,device-snmp,device-usb-camera,device-virtual" + addKnownSecrets: "redisdb[app-external-mqtt-trigger;app-http-export;app-metrics-influxdb;app-mqtt-export;app-rfid-llrp-inventory;app-sample;device-bacnet-ip;device-coap;device-gpio;device-modbus;device-mqtt;device-onvif-camera;device-rest;device-rfid-llrp;device-snmp;device-usb-camera;device-virtual],message-bus[app-external-mqtt-trigger;app-http-export;app-metrics-influxdb;app-mqtt-export;app-rfid-llrp-inventory;app-sample;device-bacnet-ip;device-coap;device-gpio;device-modbus;device-mqtt;device-onvif-camera;device-rest;device-rfid-llrp;device-snmp;device-usb-camera;device-virtual]" # resources defines the cpu and memory limits and requests for the respective application resources: