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

connect: ensure proxy-defaults protocol is used for upstreams #7938

Merged
merged 1 commit into from
May 21, 2020

Conversation

rboyer
Copy link
Member

@rboyer rboyer commented May 20, 2020

Fixes #7859

@rboyer rboyer added this to the 1.8.0 milestone May 20, 2020
@rboyer rboyer requested a review from a team May 20, 2020 22:24
@rboyer rboyer self-assigned this May 20, 2020
Copy link
Contributor

@dnephin dnephin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rboyer
Copy link
Member Author

rboyer commented May 20, 2020

FYI: If we want to backport this to 1.6 or 1.5 I suspect the patch won't apply cleanly mostly due to namespace refactoring.

@david-yu
Copy link
Contributor

Based on the official support policy, we should backport to 1.7 and 1.6.

@crhino
Copy link
Contributor

crhino commented May 21, 2020

I feel like I am missing something here, but when I tried out your reproduction steps I still got a envoy.tcp_proxy filter for the web upstream.

$ consul -v
Consul v1.7.0-727-g7e1310e02-dev (7e1310e02)
Protocol 2 spoken by default, understands 2 to 3 (agent will automatically use protocol >2 when speaking to compatible agents)

$ cat proxy-defaults.hcl
kind = "proxy-defaults"
name = "global"
config {
  protocol = "http"
}
$ consul config write proxy-defaults.hcl

$ cat foo.hcl
service {
  name = "foo"
  port = 8888

  connect {
    sidecar_service {
      proxy {
        upstreams = [
          {
            destination_name = "web"
            local_bind_port  = 5000
          },
        ]
      }
    }
  }
}

$ consul services register foo.hcl

$ consul connect envoy -sidecar-for foo

$ curl localhost:19000/config_dump
...
    {
     "name": "web:127.0.0.1:5000",
     "active_state": {
      "version_info": "00000001",
      "listener": {
       "@type": "type.googleapis.com/envoy.api.v2.Listener",
       "name": "web:127.0.0.1:5000",
       "address": {
        "socket_address": {
         "address": "127.0.0.1",
         "port_value": 5000
        }
       },
       "filter_chains": [
        {
         "filters": [
          {
           "name": "envoy.tcp_proxy",
           "config": {
            "stat_prefix": "upstream_web_tcp",
            "cluster": "web.default.dc1.internal.d06b74e9-a91e-6e29-aca2-10ef9c382d0c.consul"
           }
          }
         ]
        }
       ]
      },
      "last_updated": "2020-05-21T15:48:56.116Z"
     }
    }
...

@rboyer
Copy link
Member Author

rboyer commented May 21, 2020

You need to enable this as well (it's not activated in dev mode): https://www.consul.io/docs/agent/options#enable_central_service_config

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

Successfully merging this pull request may close these issues.

Consul service mesh upstreams are not respecting the global proxy-defaults
4 participants