Skip to content

Backport of NET-5186 Fix issue where consul-dataplane attempts to write to a read-only file system location into release/1.2.x#256

Merged
nathancoleman merged 1 commit intorelease/1.2.xfrom
backport/setcap-envoy-only/happily-flowing-muskrat
Sep 5, 2023
Merged

Backport of NET-5186 Fix issue where consul-dataplane attempts to write to a read-only file system location into release/1.2.x#256
nathancoleman merged 1 commit intorelease/1.2.xfrom
backport/setcap-envoy-only/happily-flowing-muskrat

Conversation

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

@hc-github-team-consul-core hc-github-team-consul-core commented Sep 1, 2023

Backport

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

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


Running setcap on the consul-dataplane binary results in a process that cannot see the TMPDIR envar intended to influence where the envoy bootstrap config is written to. This is due to a previously-uknown-to-us side effect of glibc, described here.

As a result, it attempts to write to the /tmp directory instead of /consul/connect-inject -- configured for injected sidecars here -- and gets a read-only file system error.

We previously considered dropping setcap for the consul-dataplane binary; however, the envoy binary that is forked from dataplane cannot itself have a capability that the consul-dataplane process does not have.

Instead, I've opted to keep setcap net_bind_service for both envoy and consul-dataplane. We can work around the fact that TMPDIR is invisible to consul-dataplane by not writing to the file system at all and using envoy --config-yaml <yaml or json string> where we were previously using envoy --config-path <string>.


Overview of commits

@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/setcap-envoy-only/happily-flowing-muskrat branch 2 times, most recently from 9093e47 to ec2fb76 Compare September 1, 2023 20:47
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

@nathancoleman nathancoleman force-pushed the backport/setcap-envoy-only/happily-flowing-muskrat branch from ec2fb76 to dee9a68 Compare September 1, 2023 20:54
@nathancoleman nathancoleman marked this pull request as ready for review September 1, 2023 21:06
@nathancoleman nathancoleman requested a review from a team as a code owner September 1, 2023 21:06
Copy link
Member

@nathancoleman nathancoleman left a comment

Choose a reason for hiding this comment

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

Matches source PR other than some additional logic that was recently added to a deleted function. The net impact is still to delete the function.

@nathancoleman nathancoleman merged commit a02561d into release/1.2.x Sep 5, 2023
@nathancoleman nathancoleman deleted the backport/setcap-envoy-only/happily-flowing-muskrat branch September 5, 2023 17:33
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.

3 participants