[Experimental] Include both privileged and non-privileged binaries in Docker image #652
+43
−14
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.
Currently, the
NET_BIND_SERVICE
capability is added to the dataplane (and Envoy) entrypoints since we cannot know at build time whether a non-root user at runtime will attempt to bind to a privileged port. The reason this is the default behavior was to avoid a breaking change in ingress gateways, which had previously supported binding to privileged ports; however, there are still many use cases where it's preferable to avoid this capability when it isn't needed.This change introduces a second set of entrypoints to the container that do not have the
NET_BIND_SERVICE
capability. In this way, we can support both use cases:The container will default to the non-privileged entrypoint, and ingress gateway deployments that do want to support binding to privileged ports will need to override the entrypoint to
privileged-consul-dataplane
and provide a path toprivileged-envoy
. This way, no deployment needs theNET_BIND_SERVICE
capability unless they are overriding the entrypoint in order to support binding to privileged ports.See hashicorp/consul-k8s#4394 for an example of how this works in consul-k8s.
Warning
We still need to determine the impact – if any – of a change like this for VM and Nomad deployments of consul-dataplane