NET-5186 Allow dataplane container to bind to privileged ports#238
Merged
nathancoleman merged 3 commits intomainfrom Aug 24, 2023
Merged
NET-5186 Allow dataplane container to bind to privileged ports#238nathancoleman merged 3 commits intomainfrom
nathancoleman merged 3 commits intomainfrom
Conversation
35acafb to
cf3a827
Compare
nathancoleman
commented
Aug 17, 2023
| FROM gcr.io/distroless/base-debian11 AS release-default | ||
|
|
||
| ARG BIN_NAME | ||
| ARG BIN_NAME=consul-dataplane |
Member
Author
There was a problem hiding this comment.
Defaulting these for building locally like we do in consul-k8s
9941048 to
a4dd9a9
Compare
curtbushko
approved these changes
Aug 23, 2023
Contributor
curtbushko
left a comment
There was a problem hiding this comment.
Thanks Nathan!
For other reviewers: we had hours upon hours of back and forth discussions on how to do this and this 'setcap' method was the best of all horrible ways to solve this problem.
We couldn't setcap at runtime since we are running a distroless image (no shell to run the setcap command...).
david-yu
approved these changes
Aug 24, 2023
This was referenced Aug 24, 2023
2 tasks
nathancoleman
added a commit
that referenced
this pull request
Aug 25, 2023
NET-5186 Allow dataplane container to bind to privileged ports
This was referenced Aug 25, 2023
Merged
Merged
nathancoleman
added a commit
that referenced
this pull request
Aug 25, 2023
NET-5186 Allow dataplane container to bind to privileged ports
nathancoleman
added a commit
that referenced
this pull request
Aug 25, 2023
NET-5186 Allow dataplane container to bind to privileged ports
2 tasks
This was referenced Oct 31, 2023
1 task
This was referenced Feb 7, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the issue
Consul-dataplane is currently unable to bind to privileged ports (< 1024).
This is important for ingress-gateway use cases where customers have historically been able to bind to ports such as
443and are encountering runtime failures when attempting to upgrade to Consul 1.15+ and the corresponding Helm chart versions. In these newer versions, consul-dataplane has taken the place of theenvoyproxy/envoycontainers that were used previously.Example of failure:
Describe the fix
It appears that Envoy containers, which consul-dataplane has replaced for ingress-gateway use cases, run as root and then use
su-execto run as a different user. I'm thinking that we can set theNET_BIND_SERVICEcapability directly on the Envoy and dataplane binaries and avoid starting up asroot, but I'm depending on my own testing and reviewers here to validate this.This PR adds a new stage to set the
net_bind_servicecapability on the Envoy and dataplane binaries that are copied into the release image. The final images then copy their Envoy and dataplane binaries from this new stage instead of their previous source.How to test
443(see example values below)Example `values.yaml`