feat(gateway-api): customize gateway deployments via class annotations#46603
feat(gateway-api): customize gateway deployments via class annotations#46603svrakitin wants to merge 2 commits intoistio:masterfrom
Conversation
|
😊 Welcome @svrakitin! This is either your first contribution to the Istio istio repo, or it's been You can learn more about the Istio working groups, code of conduct, and contributing guidelines Thanks for contributing! Courtesy of your friendly welcome wagon. |
|
Hi @svrakitin. Thanks for your PR. I'm waiting for a istio member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
217017f to
a5a565b
Compare
ec204a0 to
6dd9de6
Compare
6dd9de6 to
c20ce3d
Compare
|
This looks reasonable to me |
|
/retest EDIT: There were some flaky tests related to Ambient. |
|
sorry I didn't notice this until now, will take a look soon |
|
So I like the idea, I have some concerns on the implementation. First is GatewayClass in general. I personally don't like the idea of GatewayClass at all and have pushed in the API to remove it and/or move things way from it. But its still there and going GA so my opinion there probably doesn't matter much. In particular, I hate On the injection template: if we allow it in the class, we should probably allow it per-Gateway as well. Should be easy to add that. However, I am more concerned about the idea of providing arbitrary templates. Unlike classic sidecar pod injection, this form of templating has a subtle but critical security risk I call "YAML injection". Basically, if you write a template like networking.istio.io/service-type: |
ClusterIP
---
kind: ClusterRole
name: give-everyone-admin-permission
---You are going to have a bad time. Sidecar injection mitigates this since its always generating a Patch on a Pod object, so its impossible to create new objects. Technically, this is the template-writers' (who is the mesh admin) fault -- but its really easy to make the mistake, and the results are pretty bad. The other concern is around stability. There is (slow) progress to make some of this upstream (kubernetes-sigs/gateway-api#1757), and the API for templates may change over time (for example, WDYT? |
|
Thanks for the detailed explanation @howardjohn Sounds good, you definitely have much more context than I do! 😄 We can avoid touching Do we want to introduce something like I would then have something like: gateway.istio.io/pod-template: |
spec:
nodeSelector: {}
affinity: {}
tolerations: []This would use a strategic merge and hide Or we have a new CRD like |
|
pod-template is kind of nice since then you could also use the same templates for sidecars. Let me solicit some feedback from others and get back to you |
|
@howardjohn Thank you! |
|
🚧 This issue or pull request has been closed due to not having had activity from an Istio team member since 2023-08-23. If you feel this issue or pull request deserves attention, please reopen the issue. Please see this wiki page for more information. Thank you for your contributions. Created by the issue and PR lifecycle manager. |
|
any progress on this? related to this |
Closes #46594
This PR enhances custom
GatewayClass'es and allows a per-class customization. Currently we have templates and service types hardcoded for each controller type instead.inject.istio.io/templatesannotation onGatewayClassto pick a custom template from the istiod ConfigMap.networking.istio.io/service-typeannotation onGatewayClassto override controller's default. This annotation is already supported forGatewayto perform a per-gateway override.