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

xds: only try to create an ipv6 expose checks listener if ipv6 is supported by the kernel #9765

Merged
merged 5 commits into from Feb 19, 2021

Conversation

rboyer
Copy link
Member

@rboyer rboyer commented Feb 12, 2021

Fixes #9311

This only fails if the kernel has ipv6 hard-disabled. It is not sufficient to merely not provide an ipv6 address for a network interface. For local testing I disabled it in grub on an ubuntu linux VM first.

Then register a service with connect locally with a config file like:

...
connect {
 sidecar_service {
  proxy {
   expose {
    checks = true
   }
  }
 }
}
...

Then try launching the sidecar and grep the envoy logs for the word expose

TODO

  • add expose checks envoy integration test

@rboyer rboyer requested a review from a team February 12, 2021 21:12
@rboyer rboyer self-assigned this Feb 12, 2021
@github-actions github-actions bot added the theme/envoy/xds Related to Envoy support label Feb 12, 2021
@hashicorp-ci
Copy link
Contributor

🤔 Double check that this PR does not require a changelog entry in the .changelog directory. Reference

Copy link
Contributor

@markan markan left a comment

Choose a reason for hiding this comment

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

Looks good to me.

&envoycore.CidrRange{AddressPrefix: advertise, PrefixLen: &wrappers.UInt32Value{Value: uint32(advertiseLen)}},
)

if ok, err := kernelSupportsIPv6(); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

@rboyer and I had a chat about testing; it's kind of thorny. Mocking this gets us into trouble with parallel unit tests, as we risk changing an invariant under other tests noses.

@vercel vercel bot temporarily deployed to Preview – consul February 17, 2021 19:38 Inactive
@vercel vercel bot temporarily deployed to Preview – consul-ui-staging February 17, 2021 19:38 Inactive
checks = [
{
name = "http"
http = "http://127.0.0.1:8181/debug"
Copy link
Member Author

Choose a reason for hiding this comment

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

The fake workloads are usually copies of fortio which has a webserver builtin. One of the pages is /debug so that'll 200, hence why it's used here as the healthcheck standin.


function get_envoy_expose_checks_listener_once {
local HOSTPORT=$1
run curl -s -f $HOSTPORT/config_dump
Copy link
Member Author

Choose a reason for hiding this comment

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

Captured output from a run:

{
  "configs": [
    {
      "@type": "type.googleapis.com/envoy.admin.v3.BootstrapConfigDump",
      ...snip...
    },
    {
      "@type": "type.googleapis.com/envoy.admin.v3.ClustersConfigDump",
      ...snip...
    },
    {
      "@type": "type.googleapis.com/envoy.admin.v3.ListenersConfigDump",
      "version_info": "00000001",
      "dynamic_listeners": [
        {
          "name": "public_listener:0.0.0.0:21001",
          ...snip...
        },
        {
          "name": "exposed_path_debug:0.0.0.0:21500",
          "active_state": {
            "version_info": "00000001",
            "listener": {
              "@type": "type.googleapis.com/envoy.api.v2.Listener",
              "name": "exposed_path_debug:0.0.0.0:21500",
              "address": {
                "socket_address": {
                  "address": "0.0.0.0",
                  "port_value": 21500
                }
              },
              "filter_chains": [
                {
                  "filter_chain_match": {
                    "source_prefix_ranges": [
                      {
                        "address_prefix": "127.0.0.1",
                        "prefix_len": 8
                      },
                      {
                        "address_prefix": "127.0.0.1",
                        "prefix_len": 32
                      },
                      {
                        "address_prefix": "::1",
                        "prefix_len": 128
                      }
                    ]
                  },
                  "filters": [
                    {
                      "name": "envoy.http_connection_manager",
                      "config": {
                        "http_filters": [
                          {
                            "name": "envoy.router"
                          }
                        ],
                        "stat_prefix": "exposed_path_filter_debug_21500",
                        "route_config": {
                          "name": "exposed_path_filter_debug_21500",
                          "virtual_hosts": [
                            {
                              "routes": [
                                {
                                  "route": {
                                    "cluster": "local_app"
                                  },
                                  "match": {
                                    "path": "/debug"
                                  }
                                }
                              ],
                              "domains": [
                                "*"
                              ],
                              "name": "exposed_path_filter_debug_21500"
                            }
                          ]
                        },
                        "tracing": {
                          "random_sampling": {}
                        }
                      }
                    }
                  ]
                }
              ]
            },
            "last_updated": "2021-02-17T19:32:31.547Z"
          }
        }
      ]
    },
    {
      "@type": "type.googleapis.com/envoy.admin.v3.ScopedRoutesConfigDump"
    },
    {
      "@type": "type.googleapis.com/envoy.admin.v3.RoutesConfigDump",
      ...snip...
    },
    {
      "@type": "type.googleapis.com/envoy.admin.v3.SecretsConfigDump"
    }
  ]
}

@vercel vercel bot temporarily deployed to Preview – consul-ui-staging February 17, 2021 23:22 Inactive
@vercel vercel bot temporarily deployed to Preview – consul February 17, 2021 23:22 Inactive
@rboyer rboyer force-pushed the expose-checks-conditional-ipv6 branch from 05fea06 to 564eb23 Compare February 17, 2021 23:24
@vercel vercel bot temporarily deployed to Preview – consul-ui-staging February 17, 2021 23:24 Inactive
@vercel vercel bot temporarily deployed to Preview – consul February 17, 2021 23:24 Inactive
@rboyer rboyer requested a review from markan February 17, 2021 23:26
@vercel vercel bot temporarily deployed to Preview – consul February 18, 2021 22:53 Inactive
@vercel vercel bot temporarily deployed to Preview – consul-ui-staging February 18, 2021 22:53 Inactive
@vercel vercel bot temporarily deployed to Preview – consul-ui-staging February 19, 2021 20:31 Inactive
@vercel vercel bot temporarily deployed to Preview – consul February 19, 2021 20:31 Inactive
@rboyer rboyer merged commit 39effd6 into master Feb 19, 2021
@rboyer rboyer deleted the expose-checks-conditional-ipv6 branch February 19, 2021 20:38
@hashicorp-ci
Copy link
Contributor

🍒 If backport labels were added before merging, cherry-picking will start automatically.

To retroactively trigger a backport after merging, add backport labels and re-run https://circleci.com/gh/hashicorp/consul/329704.

@hashicorp-ci
Copy link
Contributor

🍒✅ Cherry pick of commit 39effd6 onto release/1.9.x succeeded!

hashicorp-ci pushed a commit that referenced this pull request Feb 19, 2021
…ported by the kernel (#9765)

Fixes #9311

This only fails if the kernel has ipv6 hard-disabled. It is not sufficient to merely not provide an ipv6 address for a network interface.
@hashicorp-ci
Copy link
Contributor

🍒❌ Cherry pick of commit 39effd6 onto release/1.8.x failed! Build Log

@hashicorp-ci
Copy link
Contributor

🍒❌ Cherry pick of commit 39effd6 onto release/1.7.x failed! Build Log

rboyer added a commit that referenced this pull request Feb 19, 2021
…ported by the kernel

1.8.x backport of #9765

Conflicts:
- agent/xds/listeners_test.go
- test/integration/connect/envoy/helpers.bash
- agent/xds/testdata (different envoy versions)
rboyer added a commit that referenced this pull request Feb 19, 2021
…ported by the kernel

1.7.x backport of #9765 (based on the 1.8.x backport)

Conflicts:
- agent/xds/listeners_test.go
- test/integration/connect/envoy/helpers.bash
- agent/xds/testdata (different envoy versions than even the 1.8.x backport)
rboyer added a commit that referenced this pull request Feb 22, 2021
…ported by the kernel (#9794)

1.8.x backport of #9765

Conflicts:
- agent/xds/listeners_test.go
- test/integration/connect/envoy/helpers.bash
- agent/xds/testdata (different envoy versions)
rboyer added a commit that referenced this pull request Feb 22, 2021
…6 is supported by the kernel (#9795)

1.7.x backport of #9765 (based on the 1.8.x backport)

Conflicts:
- agent/xds/listeners_test.go
- test/integration/connect/envoy/helpers.bash
- agent/xds/testdata (different envoy versions than even the 1.8.x backport)
dizzyup pushed a commit that referenced this pull request Apr 21, 2021
…ported by the kernel (#9765)

Fixes #9311

This only fails if the kernel has ipv6 hard-disabled. It is not sufficient to merely not provide an ipv6 address for a network interface.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/envoy/xds Related to Envoy support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

consul connect fails to boot envoy when health checks are exposed and ipv6 is disabled
3 participants