Hi,
i’m getting in trouble on how to create an ingress gateway for a service registered as sidecar_service.
Hi have a services exposed from a docker container at an internal port “8161” named “amq-management”. I want to create an ingress point for this service so i can resolve it with a static access point like “amq-management.ingress.dc1.consul:8080”. So i tryed to register the service using sidecar service and create an ingress point that listent on 8080 port and point to that service. Just a small premise: i tried example on hashicorp documentation and everything works fine. So i think that i haven’t understand very well how it works.
This is my nomad job:
job "activemq-job" {
datacenters = ["dc1"]
group "ActiveMQ" {
count = 1
network {
mode = "bridge"
}
service {
name = "amq-management"
id = "amq-management-1"
tags = ["activemqmanagement"]
port = "8161"
connect {
sidecar_service { }
}
}
task "ActiveMQ" {
driver = "docker"
config {
image = "..."
}
}
}
group "ingress-group" {
network {
mode = "bridge"
port "inbound" {
static = 8080
to = 8080
}
}
service {
name = "my-ingress-service"
port = "8080"
connect {
gateway {
ingress {
listener {
port = 8080
protocol = "tcp"
service {
name = "amq-management"
}
}
}
}
}
}
}
}
The problem is that group “ActiveMQ” doesn’t start because “connect-proxy-amq-management” fails with this error:
envoy_bootstrap: error creating bootstrap configuration for Connect proxy sidecar: exit status 1
looking on nomad log i have those errors:
2021-05-25T09:43:30.473+0200 [ERROR] client.alloc_runner.task_runner.task_hook.envoy_bootstrap: error creating bootstrap configuration for Connect proxy sidecar: alloc_id=9ce9b0c3-e10e-10ae-6c00-0b15df0a696e task=connect-proxy-amq-management error="exit status 1" stderr="No sidecar proxy registered for _nomad-task-9ce9b0c3-e10e-10ae-6c00-0b15df0a696e-group-ActiveMQ-amq-management-8161
May 25 09:43:30 consul02 nomad[394648]: "
May 25 09:43:30 consul02 nomad[394648]: 2021-05-25T09:43:30.474+0200 [ERROR] client.alloc_runner.task_runner: prestart failed: alloc_id=9ce9b0c3-e10e-10ae-6c00-0b15df0a696e task=connect-proxy-amq-management error="prestart hook "envoy_bootstrap" failed: error creating bootstrap configuration for Connect proxy sidecar: exit status 1"
May 25 09:43:30 consul02 nomad[394648]: 2021-05-25T09:43:30.474+0200 [INFO] client.alloc_runner.task_runner: not restarting task: alloc_id=9ce9b0c3-e10e-10ae-6c00-0b15df0a696e task=connect-proxy-amq-management reason="Exceeded allowed attempts 2 in interval 30m0s and mode is "fail""
It says that is missing sidecar proxy.
I tried to change
service {
name = "amq-management"
id = "amq-management-1"
tags = ["activemqmanagement"]
port = "8161"
connect {
sidecar_service { }
}
}
with
service {
name = "amq-management"
id = "amq-management-1"
tags = ["activemqmanagement"]
port = "8161"
connect {
sidecar_service {
proxy {
local_service_port = 8161
}
}
}
}
but the output is the same error
I tried executing this command:
consul connect proxy -sidecar-for amq-management-1 > amq-proxy.log &
and the error is the same too
What’s wrong in what i have done?