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

pilot: gateway listeners should respect targetPort #20838

Merged
merged 4 commits into from Feb 5, 2020

Conversation

dgn
Copy link
Contributor

@dgn dgn commented Feb 4, 2020

This makes sure that you can define non-privileged targetPorts for your ingress-gateway services. It also changes the default listener ports to non-privileged ports.

[x] Networking

@dgn dgn requested review from a team as code owners February 4, 2020 09:23
@googlebot googlebot added the cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. label Feb 4, 2020
@istio-testing istio-testing added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 4, 2020
@dgn
Copy link
Contributor Author

dgn commented Feb 4, 2020

@costinm @howardjohn this is part of the multi-tenancy work: it enables non-privileged gateway pods

@dgn
Copy link
Contributor Author

dgn commented Feb 4, 2020

/retest

@howardjohn
Copy link
Member

Interesting, seems like something we should have already done 🙂

would prefer if @rshriram also takes a look in case there is some reason this is a bad idea I am missing, but I assume you have done this on maistra for a while?

@dgn dgn force-pushed the dgn/gateway-on-target-port branch from ce35292 to 97fcb5d Compare February 4, 2020 20:22
},
},
},
[]string{"0.0.0.0_8080"},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For ingress gateway, there is no inbound listener, so the target port does not take effect for it.

Copy link
Contributor Author

@dgn dgn Feb 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @hzxuzhonghu, is this a problem with the test I wrote or the implementation? I tested this with an ingress-gateway and it works, it creates a listener on the targetPort instead of the port

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The listener of gateway should have nothing to do with the targetport.

Copy link
Contributor Author

@dgn dgn Feb 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't agree, that's the whole point of the change: to have an ingress-gateway service with port: 80 and targetPort: 8080, so that an Ingress resource can still point to port 80 of the ingress-gateway service, but the pod running the gateway listens on port 8080, which does not require elevated privileges.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We currently assume in the code that port and targetPort for services targeting gateways are always the same, which they don't have to be.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood now

@howardjohn
Copy link
Member

/retest

@istio-testing istio-testing merged commit c9d0c9d into istio:master Feb 5, 2020
sdake pushed a commit to sdake/istio that referenced this pull request Feb 21, 2020
* Respect targetPort in gateway listener generation

* Change listening ports to unprivileged ports (>1023)

* Update operator's golden files

* Fix linting issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/networking cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants