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 transparent proxy support #20175

Merged
merged 9 commits into from
Apr 10, 2024
Merged

Connect transparent proxy support #20175

merged 9 commits into from
Apr 10, 2024

Commits on Apr 4, 2024

  1. transparent proxy: add jobspec support (#20144)

    Add a transparent proxy block to the existing Connect sidecar service proxy
    block. This changeset is plumbing required to support transparent proxy
    configuration on the client.
    
    Ref: #10628
    tgross committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    e8d203e View commit details
    Browse the repository at this point in the history
  2. tproxy: networking hook changes (#20183)

    When `transparent_proxy` block is present and the network mode is `bridge`, use
    a different CNI configuration that includes the `consul-cni` plugin. Before
    invoking the CNI plugins, create a Consul SDK `iptables.Config` struct for the
    allocation. This includes:
    
    * Use all the `transparent_proxy` block fields
    * The reserved ports are added to the inbound exclusion list so the alloc is
      reachable from outside the mesh
    * The `expose` blocks and `check` blocks with `expose=true` are added to the
      inbound exclusion list so health checks work.
    
    The `iptables.Config` is then passed as a CNI argument to the `consul-cni`
    plugin.
    
    Ref: #10628
    tgross committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    76009d8 View commit details
    Browse the repository at this point in the history
  3. docs: update service mesh integration docs for transparent proxy (#20251

    )
    
    Update the service mesh integration docs to explain how Consul needs to be
    configured for transparent proxy. Update the walkthrough to assume that
    `transparent_proxy` mode is the best approach, and move the manually-configured
    `upstreams` to a separate section for users who don't want to use Consul DNS.
    
    Ref: #20175
    Ref: #20241
    tgross committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    bb062de View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d1f3a72 View commit details
    Browse the repository at this point in the history

Commits on Apr 5, 2024

  1. tproxy: job submission hooks (#20244)

    Add a constraint on job submission that requires the `consul-cni` plugin
    fingerprint whenever transparent proxy is used.
    
    Add a validation that the `network.dns` cannot be set when transparent proxy is
    used, unless the `no_dns` flag is set.
    tgross committed Apr 5, 2024
    Configuration menu
    Copy the full SHA
    8b6d6e4 View commit details
    Browse the repository at this point in the history
  2. tproxy: E2E tests (#20296)

    Add the `consul-cni` plugin to the Linux AMI for E2E, and add a test case that
    covers the transparent proxy feature. Add test assertions to the Connect tests
    for upstream reachability
    
    Ref: #20175
    tgross authored Apr 5, 2024
    Configuration menu
    Copy the full SHA
    548adb0 View commit details
    Browse the repository at this point in the history

Commits on Apr 10, 2024

  1. Configuration menu
    Copy the full SHA
    e2e561d View commit details
    Browse the repository at this point in the history
  2. tproxy: refactor getPortMapping

    The `getPortMapping` method forces callers to handle two different data
    structures, but only one caller cares about it. We don't want to return a single
    map or slice because the `cni.PortMapping` object doesn't include a label field
    that we need for tproxy. Return a new datastructure that closes over both a
    slice of `cni.PortMapping` and a map of label to index in that slice.
    tgross committed Apr 10, 2024
    Configuration menu
    Copy the full SHA
    4fef82e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9340c77 View commit details
    Browse the repository at this point in the history