-
Notifications
You must be signed in to change notification settings - Fork 687
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
Launch envoy through capability wrapper #2050
base: master
Are you sure you want to change the base?
Launch envoy through capability wrapper #2050
Conversation
Don't merge this just yet... Going to do a bit more testing. The tests don't run locally and I want to see if they work in CI. |
287fac7
to
8d33416
Compare
8d33416
to
f9d061c
Compare
f9d061c
to
0d43857
Compare
This works fine locally, I'll be darned if I can get tests to pass (on this branch or master) on my Mac or on a new |
With the latest rebase it's now only my tests that are failing. I'll try it again locally. |
c442dfe
to
15c6d4e
Compare
Hey, now that we've gotten past the 1.0 transition I'd like to get this landed. Need help from us to get tests sorted out? |
Hey, yes, please. Give me some time to get caught up and rebased so I know what the current problem is. Thanks! |
setcap(8) doesn't work on symlinks. This was a regression in 1.3.0. Fortunately, because #2050 hasn't landed yet, that didn't actually affect anything.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
A million apologies. Let me get this rebased and over the line. |
86f52b8
to
dc6922a
Compare
Is there still an issue running tests on a mac? I tried
|
@swalberg I run them on a Mac a lot -- what kind of cluster were you trying to use? |
I'm using docker-desktop. Happy to change it to whatever works. |
I don't think the whole test suite can fit into Docker on a Mac. 🙁 Internally, we have an old tool called Kubernaut that provisions clusters in EC2, but really any cluster should work, it's just that the tests spin up a lot of Ambassadors, so a beefy cluster is a must. Alternately, if you merge |
Oh, I can find a bigger test cluster then. I had it in our cluster for testing but since we're so far behind on Ambassador I can't use current versions. This'll change soon 🤞 . |
Just a note that we've upgraded things here enough that I can get back to testing. |
I'm getting crashes on the capabilities wrapper now. I see there was a minor refactoring in 58c1267 to extract it which seems related. I'm having trouble explaining what I'm seeing, but it looks like the return address of I can't explain it yet, but here's a gist to show I'm not nuts: https://gist.github.com/swalberg/c4b50e395c239920863f898551a12c24 |
6af5080
to
0f9801b
Compare
Bah is there a way to re-run this? Looks like there was a connection reset in the middle of it when it tries to pull down the gcloud tools. |
a20b8a6
to
778c8bd
Compare
778c8bd
to
dd9d184
Compare
Is there a way to run just one test locally? I tried |
|
…eshu/dstuff Separate dlib
…et/dev/master/pin-pip ambassador/builder: pin pip to 20.2.4
fix doc typo add browser test update changelog add some unit tests add comments to tests
…ite-preview Always run website-preview, even when it'll be a no-op.
…to flynn/dev/from-oss
…-datawire Sync Datawire changes
(cherry picked from commit b602adf)
…adf-master Update gRPC example for insecure host
…/tutorial-master [master] Revise tutorial
(if capabilities are present) When capabilities are explicitly dropped ``` sean~/play/ambassador (use_capabilities_wrapper *%)$ kubectl logs ambassador-7cb95448b8-mjxhp | grep cap 2019-11-21 17:59:05 AMBASSADOR INFO cap_net_bind_service is not supported, launching Envoy directly ``` When capabilities are present ``` sean~/play/ambassador (use_capabilities_wrapper *%)$ kubectl logs ambassador-bdbc4675d-hmq82 | grep cap 2019-11-21 18:00:08 AMBASSADOR INFO cap_net_bind_service is supported, launching Envoy through a wrapper 2019/11/21 18:00:08 Starting Envoy with CAP_NET_BIND_SERVICE capability 2019/11/21 18:00:08 Succeeded in setting capabilities ``` Additionally, if the capabilities are present, you can bind Envoy to a low port, e.g. 80 or 443: ``` bash-5.0$ netstat -anp | grep 0.0.0.0:80 tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN - bash-5.0$ ps -ef | grep [w]rapper 167 8888 0:06 {envoy} wrapper -c /ambassador/bootstrap-ads.json ``` Add missing import Try commenting out tests to see if it's me
This reverts commit d2cf331.
(if capabilities are present) When capabilities are explicitly dropped ``` sean~/play/ambassador (use_capabilities_wrapper *%)$ kubectl logs ambassador-7cb95448b8-mjxhp | grep cap 2019-11-21 17:59:05 AMBASSADOR INFO cap_net_bind_service is not supported, launching Envoy directly ``` When capabilities are present ``` sean~/play/ambassador (use_capabilities_wrapper *%)$ kubectl logs ambassador-bdbc4675d-hmq82 | grep cap 2019-11-21 18:00:08 AMBASSADOR INFO cap_net_bind_service is supported, launching Envoy through a wrapper 2019/11/21 18:00:08 Starting Envoy with CAP_NET_BIND_SERVICE capability 2019/11/21 18:00:08 Succeeded in setting capabilities ``` Additionally, if the capabilities are present, you can bind Envoy to a low port, e.g. 80 or 443: ``` bash-5.0$ netstat -anp | grep 0.0.0.0:80 tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN - bash-5.0$ ps -ef | grep [w]rapper 167 8888 0:06 {envoy} wrapper -c /ambassador/bootstrap-ads.json ``` Add missing import Try commenting out tests to see if it's me
This reverts commit d2cf331.
Yes, it segfaults unless that Println is there. Something about that data.Inheritable smashing the retval on the stack.
The Ambassador container needs both the NET_BIND_SERVICE capability and also securityContext.allowPrivilegeEscalation to be enabled, so updating the init script to check for both. It checks to make sure it's not disabled (love these double negatives) so that if we're on a non docker runtime it won't get tripped up.
a1a404f
to
b2d3e74
Compare
Old place didn't seem to get executed first
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Funny enough, PodSecurityPolicies are being removed from K8s, which is the reason I needed this wrapper. Seems like there are a lot of changes since I looked at this. Is this solution still viable? |
FWIW, I still want to get this in. |
This feature would still be nice. |
(if capabilities are present)
When capabilities are explicitly dropped
When capabilities are present
Additionally, if the capabilities are present, you can bind Envoy to a
low port, e.g. 80 or 443:
Related Issues
Fixes #1841
Testing
Manual testing and added CI tests.
Todos
Other
master
.