consul-k8s icon indicating copy to clipboard operation
consul-k8s copied to clipboard

Backport of Add HOST_IP environment variable to consul_dataplane_sidecar.go into release/1.1.x

Open hc-github-team-consul-core opened this issue 5 months ago • 0 comments

Backport

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

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


[!NOTE] This is sourced from https://github.com/hashicorp/consul-k8s/pull/3916. I needed to open here so that CI requiring tokens that are unavailable in forks can run

Changes proposed in this PR

  • Add HOST_IP environment variable to consul_dataplane_sidecar.go

This environment variable must be set in order to utilize HOST_IP as part of statsd or dogstatsd sinks. If this variable is unset and the sink is configured to use HOST_IP, the sidecar won't start and pods won't come up healthy.

How I've tested this PR

  • Unit tests
  • Deployed and tested a local build to our cluster and confirmed that injected pods now come up healthy and have the HOST_IP variable set as expected

How I expect reviewers to test this PR

  • The unit tests should do it

    Reference to similar change for mesh-gateway deployments:

    • https://github.com/hashicorp/consul-k8s/blob/8ac97bf0dc70576e01ade4337700c9f78ed54908/CHANGELOG.md?plain=1#L763
    • https://github.com/hashicorp/consul-k8s/pull/1808

Checklist


Overview of commits
  • 6982b65ec569b71bb987240ad984a76a7e4da272 - 63df1186f352575202f5b38438e7b8b0b4504936 - fadb91efb9bb8cd1ab08c69f71654ae7c40edfd7 - 6e0710585db5956f7611fd714e4407c70f5685a5 - 7f7aa406671fa886196a6e30ca9bed9a1fe2324c - 2bae8a516f8614c82fab41528518d74d24f87064 - f20395b795f60082516f1875d78037beef76b16f - cc1a64037ba18b2eb16dd51f6af572726c99a0fb - fbee95e9873c06d28d8c493e6de72434ea4c03dc - 9dc8708cd00360ad430e28485698e56f654e0973