Solutions
LE Sparkplug Edge Node
Environment Variables
5 min
overview the le sparkplug edge node can be configured using environment variables passed during the docker run command this method is an alternative to using the docid\ derq8vikrcedo8sfwcpqs , which is the recommended approach, especially for complex setups like tls if a config json file is mounted and environment variables are also set, the environment variables will take precedence variables the following environment variables are available true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type mqtt servers json when providing the mqtt servers value as an environment variable, ensure the json string is properly escaped for your shell for tls configuration within this variable, see the docid 8gggoql nhxixhrfztgb7 guide configuration example (with tls and other options) docker run d name le sparkplug network host e edge api token="\<your litmus edge api token>" e primary host support=true e primary host id="\<your primary host id>" e le store and forward=false e group id="mygroup" e node id="myedgenode" e mqtt servers='\[{\\"url\\" \\"ssl //\<broker ip or hostname> 8883\\",\\"user\\" \\"\<mqtt username>\\",\\"password\\" \\"\<mqtt password>\\",\\"ca cert\\" \\"\<base64 ca cert>\\",\\"client cert\\" \\"\<base64 client cert>\\",\\"client key\\" \\"\<base64 client key>\\",\\"skip cert verify\\"\ false}]' e le logging level="debug" \<imgname> \<tagname> remember to replace placeholders and handle json escaping carefully { "edge api token" "0iriyynzv5xjac1aupqxm4j2tzuls5pf", // example token "group id" "le group", "node id" "le node", "primary host support" true, // enabled "primary host id" "le 97is6vf", // required if primary host support is true "le store and forward" false, // disabled by default "le logging level" "info", "mqtt" { "servers" \[ { "url" "ssl //mqtt secure com 8883", // example tls server "user" "myuser", "password" "mypassword", "ca cert" "ls0tls1crudjtibdrvjusuzjq0futck1jsuvkakndqwrzq0 ", // base64 encoded "client cert" "ls0tls1crudjtibsu0egufvcteldietfws0tprd0lc ", // base64 encoded "client key" "ls0tls1crudjtibsu0egufjjvkfursblrvktulcrxdf ", // base64 encoded "skip cert verify" false }, { "url" "tcp\ //mqtt insecure com 1883", // example non tls server "username" "admin", "password" "admin@" } ], "client id" "", // auto generated if blank "client id suffix" "le spb", // optional suffix "connect timeout" "30s", "write timeout" "3s", "keepalive" 30 } }