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

Backport of [NET-5217] [OSS] Derive sidecar proxy locality from parent service into release/1.16.x #18438

Conversation

hc-github-team-consul-core
Copy link
Collaborator

Backport

This PR is auto-generated from #18437 to be assessed for backporting due to the inclusion of the label backport/1.16.

🚨

Warning automatic cherry-pick of commits failed. If the first commit failed,
you will see a blank no-op commit below. If at least one commit succeeded, you
will see the cherry-picked commits up to, not including, the commit where
the merge conflict occurred.

The person who merged in the original PR is:
@zalimeni
This person should manually cherry-pick the original PR into a new backport PR,
and close this one when the manual backport PR is merged in.

merge conflict error: POST https://api.github.com/repos/hashicorp/consul/merges: 409 Merge conflict []

The below text is copied from the body of the original PR.


When registering sidecar proxies, ensure that locality is inherited from the parent service unless explicitly provided for the sidecar.

Also add logging to make inconsistencies between locality-aware routing policy and available locality data more obvious so that failover is not silently skipped unintentionally. (Enterprise-only)

Backporting only to 1.16.x since this feature was introduced in Consul 1.16.0.

Corresponding K8s PR: hashicorp/consul-k8s#2748

Description

  • Inherit locality when registering sidecars
  • Log warning when locality is missing with failover

Testing & Reproduction steps

  • Added unit tests covering both changes in locality inheritance behavior

This creates the expected result when running enterprise int tests:

dd412229~static-server.default.dc1.internal.ea3f0006-415c-2bac-9779-321f3d10f883.consul=(*endpointv3.ClusterLoadAssignment)(0x40013608a0)(
cluster_name:"dd412229~static-server.default.dc1.internal.ea3f0006-415c-2bac-9779-321f3d10f883.consul" 
endpoints:{
  lb_endpoints:{
    endpoint:{
      address:{
        socket_address:{
          address:"172.17.0.3" 
          port_value:21001
        }
      }
    } 
    health_status:HEALTHY 
    load_balancing_weight:{
      value:1
    }
  }
} 
endpoints:{
  lb_endpoints:{
    endpoint:{
      address:{
        socket_address:{
          address:"172.17.0.3" 
          port_value:21002
        }
      }
    } 
    health_status:UNHEALTHY 
    load_balancing_weight:{
      value:1
    }
  } 
  priority:1
} 
endpoints:{
  lb_endpoints:{
    endpoint:{
      address:{
        socket_address:{
          address:"172.17.0.3" 
          port_value:21000
        }
      }
    } 
    health_status:HEALTHY 
    load_balancing_weight:{
      value:1
    }
  } 
  priority:2
})

PR Checklist

  • updated test coverage
  • external facing docs updated
  • appropriate backport labels added
  • not a security concern

Overview of commits

@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/zalimeni/net-5217-derive-proxy-locality-from-parent-service-oss/totally-pretty-dingo branch from e3261fa to 7b58fc9 Compare August 10, 2023 18:03
Copy link
Collaborator

Choose a reason for hiding this comment

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

Auto approved Consul Bot automated PR

@hashicorp-cla
Copy link

hashicorp-cla commented Aug 10, 2023

CLA assistant check
All committers have signed the CLA.

@zalimeni
Copy link
Member

The logging change portion (1 of 2 squashed commits) doesn't need to be backported to 1.16 due to the changes it targets not having been backported. The primary fix commit is retained here.

@zalimeni zalimeni force-pushed the backport/zalimeni/net-5217-derive-proxy-locality-from-parent-service-oss/totally-pretty-dingo branch from 09a7497 to a5235ca Compare August 10, 2023 18:31
@zalimeni zalimeni marked this pull request as ready for review August 10, 2023 18:31
Partial backport to include fix without logging changes (logging targets
code not included in 1.16.x).
@zalimeni zalimeni force-pushed the backport/zalimeni/net-5217-derive-proxy-locality-from-parent-service-oss/totally-pretty-dingo branch from a5235ca to 3b9429b Compare August 10, 2023 18:33
@zalimeni zalimeni enabled auto-merge (squash) August 10, 2023 18:35
@zalimeni zalimeni merged commit 921859b into release/1.16.x Aug 10, 2023
104 checks passed
@zalimeni zalimeni deleted the backport/zalimeni/net-5217-derive-proxy-locality-from-parent-service-oss/totally-pretty-dingo branch August 10, 2023 18:47
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.

4 participants