Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't start envoy with instruction from Secure Service Communication tutorial #15

Open
strogiyotec opened this issue Jul 16, 2021 · 2 comments

Comments

@strogiyotec
Copy link

Hey, so I was trying to run the environment described in this tutorial . However , I wasn't able to start envoy with this command

consul connect envoy -sidecar-for counting-1 -admin-bind localhost:19001 > counting-proxy.log &

The error output was [external/envoy/source/server/server.cc:594] exiting cannot bind '127.0.0.1:21000': Address already in use
After checking the documentation I found that sidecar chooses random port starting from 21000, I tried to reconfigure counting and dashboard by specifying a port explicitly
counting.json

{
    "service": {
        "name": "counting",
        "id": "counting-1",
        "port": 9003,
        "check": {
            "http": "http://localhost:9003/health",
            "method": "GET",
            "interval": "1s",
            "timeout": "1s"
        },
        "connect": {
            "sidecar_service": {
                "port": 21250
            }
        }
    }
}

dashbord.json

{
    "service": {
        "name": "dashboard",
        "port": 9002,
        "connect": {
            "sidecar_service": {
                "port": 21100,
                "proxy": {
                    "upstreams": [
                        {
                            "destination_name": "counting",
                            "local_bind_port": 5000
                        }
                    ]
                }
            }
        },
        "check": {
            "id": "dashboard-check",
            "http": "http://localhost:9002/health",
            "method": "GET",
            "interval": "1s",
            "timeout": "1s"
        }
    }
}

And after that envoy was able to start proxies. I am not sure is it a bug in consul or developers are supposed to explicitly specify sidecar ports ?
My consul version is 1.10.0 and envoy is '1.18.3'

@strogiyotec strogiyotec changed the title Can't start envoy with instruction from Back to consulconsul CLI Quick Start Introduction to Consul Install Consul Run the Consul Agent Register a Service with Consul Service Discovery Secure Service Communication with Consul Service Mesh and Envoy Store Data in Consul KV Explore the Consul UI Create a Local Consul Datacenter Next Steps Secure Service Communication with Consul Service Mesh and Envoy tutorial Can't start envoy with instruction from Secure Service Communication tutorial Jul 16, 2021
@blake
Copy link
Member

blake commented Aug 24, 2021

Hi @strogiyotec, Consul should be automatically assigning non-conflicting ports to proxies. You should not need to explicitly define the upstream listener port.

Are you still seeing a port conflict if you remove the static port declaration from the sidecar service registrations?

@carlos-lehmann
Copy link

Hello!

I'm running into a similar issue. I'm using 2 hosts that I want to establish service mesh with Consul and envoy.
When I use connect without the admin bind on the counting service (source) I get:
consul connect envoy -sidecar-for counting-1

cannot bind '127.0.0.1:19000': Address already in use - fair enough, I guess that's why there was the admin bind to 19001

With admin bind I get:
consul connect envoy -sidecar-for counting-1 -admin-bind localhost:19001

[2021-12-10 16:10:55.038][98621][warning][config] [bazel-out/k8-opt/bin/source/common/config/_virtual_includes/grpc_stream_lib/common/config/grpc_stream.h:101] DeltaAggregatedResources gRPC config stream closed: 14, upstream connect error or disconnect/reset before headers. reset reason: connection failure

I have GRPC active on all Consul client and Server agents:
"ports": { "grpc": 8502 },

Can connect to the consul server agents on the port (8502) and have it configured there as well. I have also enabled connect on the consul server agents.

Consul version: 1.10.4 (server) 1.10.3 (client)
Envoy version on the clients: envoy version: 98c1c9e9a40804b93b074badad1cdf284b47d58b/1.18.3/Clean/RELEASE/BoringSSL

Any help, would be much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants