I’m having issues communicating with another service over WebSockets. I’ve already tested everything to be working with host networking but I’d like to get it working with Consul Connect.
I’m trying to reach ws://localhost:3000 from my home-assistant service but it cannot be reached. Does anything look off in the job config? Note that my default policy is allow. Thanks for looking into it!
job "haus-command" {
datacenters = ["dc1"]
group "home-assistant" {
count = 1
network {
mode = "bridge"
}
service {
name = "home-assistant"
connect {
sidecar_service {
proxy {
upstreams {
destination_name = "zwavejs2mqtt-websocket"
local_bind_port = 3000
}
}
}
}
}
task "home-assistant" {
driver = "docker"
env {
TZ = "America/Los_Angeles"
}
config {
image = "homeassistant/home-assistant:2021.12"
privileged = true
# Required for discovery mode
network_mode = "host"
volumes = [
"/mnt/data/home-assistant:/config",
]
}
}
}
group "zwavejs2mqtt" {
count = 1
network {
mode = "bridge"
port "http" {
# Serves on host port
static = 8091
to = 8091
}
}
# Websocket server
service {
name = "zwavejs2mqtt-websocket"
port = "3000"
connect {
sidecar_service {}
}
}
# Web interface
service {
name = "zwavejs2mqtt-web"
port = "http"
}
task "zwavejs2mqtt" {
driver = "docker"
config {
image = "zwavejs/zwavejs2mqtt:6.1.0"
volumes = [
"/mnt/data/zwavejs2mqtt:/usr/src/app/store/",
]
devices = [
{
# Serial port for USB Z-Wave controller
host_path = "/dev/ttyACM0"
container_path = "/dev/zwave"
},
]
}
}
}
}