-
Notifications
You must be signed in to change notification settings - Fork 10
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
NET-5186 Allow dataplane container to bind to privileged ports #238
Conversation
35acafb
to
cf3a827
Compare
@@ -22,7 +36,8 @@ RUN apk add dumb-init | |||
# ----------------------------------- | |||
FROM gcr.io/distroless/base-debian11 AS release-default | |||
|
|||
ARG BIN_NAME | |||
ARG BIN_NAME=consul-dataplane |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Defaulting these for building locally like we do in consul-k8s
9941048
to
a4dd9a9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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...).
NET-5186 Allow dataplane container to bind to privileged ports
NET-5186 Allow dataplane container to bind to privileged ports
…ports into release/1.0.x (#248) Merge pull request #238 from hashicorp/distroless-capabilities NET-5186 Allow dataplane container to bind to privileged ports Co-authored-by: Nathan Coleman <[email protected]>
NET-5186 Allow dataplane container to bind to privileged ports
…ports into release/1.2.x (#247) Merge pull request #238 from hashicorp/distroless-capabilities NET-5186 Allow dataplane container to bind to privileged ports Co-authored-by: Nathan Coleman <[email protected]>
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
443
and 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/envoy
containers 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-exec
to run as a different user. I'm thinking that we can set theNET_BIND_SERVICE
capability 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_service
capability 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`