Skip to content
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

Add proxy protocol support to gateway deployments #676

Merged
merged 1 commit into from
Apr 12, 2019
Merged

Add proxy protocol support to gateway deployments #676

merged 1 commit into from
Apr 12, 2019

Conversation

techmunk
Copy link
Contributor

@techmunk techmunk commented Apr 12, 2019

As per the subject, this adds support for the envoy proxy protocol flag for gateway deployments. This is my first time coding in Go and I'd never heard of Gloo 12 hours ago so please be gentle. :)

I was unsure if I needed to commit the generated code stuff or not as it seemed to change a lot more than just the stuff I had modified. Hopefully this is a CI thing.
I've tested this code with a haproxy instance using the following listener config and it seems to work:

server-template http 1 _http._tcp.gateway-proxy.l7-edge.svc.cluster.local resolvers kubernetes send-proxy-v2

I updated the default gateways using the following command

kubectl -n l7-edge patch gateways.gateway.solo.io gateway --type=merge -p '{"spec": {"use_proxy_proto": true}}'

Everything seems to be working just fine.
BOT NOTES:
resolves #676

@soloio-bot
Copy link

Waiting for approval from someone in the solo-io org to start testing.

@soloio-bot
Copy link

Issues linked to changelog:
#676

@ilackarms
Copy link
Member

/test

@ilackarms
Copy link
Member

ilackarms commented Apr 12, 2019

hi @techmunk, i can't understate how impressed I am by this PR! You seem to have very quickly grokked many things about Gloo. really quite impressive! this lgtm and is a nice feature to add.

in order to get any PR that modifies .proto files to pass CI, you'll need to regenerate Gloo's generated code.

the steps for doing so are:

make pin-repos
make update-deps
make -B generated-code

from the root of the gloo project directory.

we really ought to document these steps for contributors.. sorry it's not already done!

@techmunk
Copy link
Contributor Author

@ilackarms Thanks for the feedback! grep and google are my friends.
I've already run the commands you mentioned before building and testing. However it seems to have changed much more than I would have expected.

	modified:   ../../../../docs/v1/github.com/solo-io/gloo/projects/gateway/api/v1/gateway.proto.sk.md
	modified:   ../../../../docs/v1/github.com/solo-io/gloo/projects/gloo/api/v1/proxy.proto.sk.md
	modified:   ../../../clusteringress/pkg/api/v1/cluster_ingress.pb.go
	modified:   ../api/v1/gateway.pb.go
	modified:   ../api/v1/gateway.sk.go
	modified:   ../api/v1/gateway_client_test.go
	modified:   ../api/v1/virtual_service.pb.go
	modified:   ../../../gloo/pkg/api/v1/artifact.pb.go
	modified:   ../../../gloo/pkg/api/v1/circuit_breaker.pb.go
	modified:   ../../../gloo/pkg/api/v1/endpoint.pb.go
	modified:   ../../../gloo/pkg/api/v1/extensions.pb.go
	modified:   ../../../gloo/pkg/api/v1/load_balancer.pb.go
	modified:   ../../../gloo/pkg/api/v1/plugins.pb.go
	modified:   ../../../gloo/pkg/api/v1/plugins/aws/aws.pb.go
	modified:   ../../../gloo/pkg/api/v1/plugins/azure/azure.pb.go
	modified:   ../../../gloo/pkg/api/v1/plugins/consul/consul.pb.go
	modified:   ../../../gloo/pkg/api/v1/plugins/faultinjection/fault.pb.go
	modified:   ../../../gloo/pkg/api/v1/plugins/grpc/grpc.pb.go
	modified:   ../../../gloo/pkg/api/v1/plugins/grpc_web/grpc_web.pb.go
	modified:   ../../../gloo/pkg/api/v1/plugins/hcm/hcm.pb.go
	modified:   ../../../gloo/pkg/api/v1/plugins/kubernetes/kubernetes.pb.go
	modified:   ../../../gloo/pkg/api/v1/plugins/rest/rest.pb.go
	modified:   ../../../gloo/pkg/api/v1/plugins/retries/retries.pb.go
	modified:   ../../../gloo/pkg/api/v1/plugins/service_spec.pb.go
	modified:   ../../../gloo/pkg/api/v1/plugins/static/static.pb.go
	modified:   ../../../gloo/pkg/api/v1/plugins/subset_spec.pb.go
	modified:   ../../../gloo/pkg/api/v1/plugins/transformation/parameters.pb.go
	modified:   ../../../gloo/pkg/api/v1/plugins/transformation/prefix_rewrite.pb.go
	modified:   ../../../gloo/pkg/api/v1/plugins/transformation/transformation.pb.go
	modified:   ../../../gloo/pkg/api/v1/proxy.pb.go
	modified:   ../../../gloo/pkg/api/v1/secret.pb.go
	modified:   ../../../gloo/pkg/api/v1/settings.pb.go
	modified:   ../../../gloo/pkg/api/v1/ssl.pb.go
	modified:   ../../../gloo/pkg/api/v1/subset.pb.go
	modified:   ../../../gloo/pkg/api/v1/upstream.pb.go
	modified:   ../../../gloo/pkg/plugins/aws/filter.pb.go
	modified:   ../../../ingress/pkg/api/v1/ingress.pb.go
	modified:   ../../../ingress/pkg/api/v1/service.pb.go

All of it seems like formatting and style guide stuff. Is there something else I'm missing or not got setup correctly? Or is the above expected?
Should I just pick out the parts that apply to the changes I've made? Submitting all of it seems like a bit much.

@techmunk
Copy link
Contributor Author

I've pushed it all up. I'm not convinced it should all be added though.

@techmunk
Copy link
Contributor Author

Ok. Figured it out. I was running with protoc v 3.7.0. Downgraded to 3.6.1 and this seems a bit more like what I was expecting.

@ilackarms
Copy link
Member

sorry, should have mentioned our builds use 3.6.1. still impressed.

@ilackarms
Copy link
Member

/test

@soloio-bulldozer soloio-bulldozer bot merged commit 748507b into solo-io:master Apr 12, 2019
@rickducott
Copy link

I've been seeing this on other projects too -- we should probably add a solo-kit check that ensures the exact version of protoc is on the path or print a helpful error message. solo-io/solo-kit#135

Alternatively we could add it to the solo kit wrapper in this repo.

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.

None yet

4 participants