-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Enable CORS configuration #10040
Comments
kind/feature |
/area networking |
@markusthoemmes @vagababov have a look |
/assign @tcnghia @nak3 @ZhiminXiang |
I am wondering that this kind of custom configuration should be supported by each KIngress's (net-istio, net-contour, etc...) as their plugin 🤔 But I don't have any good conclusion yet. |
@nak3 Do you mean the global configuration in KIngress's controller (net-istio, net-contour, etc...)? In that way it can't be configured separately for each service . And I think we can configure the global Configuration in configmap |
@tcnghia @ZhiminXiang What do you think about this? |
I am not so positive to introduce the complex annotations. CORS policy will need 5 or 6 new annotation settings... There isn't any smart or simple way? And it would be a minor problem but if you support it as global configuration, all Kingress must support it in the same way. |
To avoid introducing the complex annotations, we can support just CORS enable setting, at least. Such as allow-methods: Default: GET, PUT, POST, DELETE, PATCH, OPTIONS
allow-headers: Default DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization
allow-origin: Default *
allow-credentials: Default true
max-age: 1728000 |
Can't the service itself send the respective CORS headers? 🤔 |
@markusthoemmes yes,we can. But is it much better if we separate service code and Cors configuration? Follow the 12-factor APP |
I'm not quite sure how this would relate to 12-factor, can you point out which rule you see violated if the service itself returns the respective CORS headers? If it can be solved as "easily" as saying: just return the CORS headers you need from your app, I'd vote -1 on including it into our Ingress APIs, seeing as we kinda want to keep them as flat and of little surface as we can. Anything we add is more customized bits we need to make sure interact well with the entire ecosystem. |
@markusthoemmes III Config: https://12factor.net/config. |
knative-sandbox/net-istio/issues#389 knative/serving/issues/10040
knative-sandbox/net-istio/issues#389 knative/serving/issues/10040
knative-sandbox/net-istio/issues#389 knative/serving/issues/10040
knative-sandbox/net-istio/issues#389 knative/serving/issues/10040
knative-sandbox/net-istio/issues#389 knative/serving/issues/10040
|
knative-sandbox/net-istio/issues#389 knative/serving/issues/10040
knative-sandbox/net-istio/issues#389 knative/serving/issues/10040
knative-sandbox/net-istio/issues#389 knative/serving/issues/10040
Thought about this again. How should this feature align with Ingress V2 https://kubernetes-sigs.github.io/service-apis/concepts/? The context here is that we plan to use Ingress V2 as the intermediate ingress resources for the long term. (You can consider Ingrerss V2 will be a replacement to current Kingress). Because of this, it requires the new Knative networking features align with Ingress V2. A open question here for Knative networking is: how we can make Knative networking extensible for the features that are not supported by Ingress V2? Currently we can pass annotations to Kingress, and let contributors customize Kingress implementation based on the annotations. But with Ingress V2, seems like contributors have to work with the specific Ingress V2 solution (e.g. Istio) to support those customized features 🤔 |
@ZhiminXiang Why we can't paas annotations to Ingress V2(Such as |
@zhaojizhuang it works with the current infra as currently we have `net-*) controller that can consume the annotations within Kingress, and then translate to the corresponding networking solutions (e.g. Istio, contour, kong, etc). In the ingress V2 world, we will get rid of |
@ZhiminXiang In another word, It is the provider(e.g. Istio, contour, Kong networking solution)‘s own to to implement or not implement this feature. Right? If that case, we do not need to do it in knative. And I want to know, when will we depricate |
Yes exactly.
We don't have the specific timeline yet as the Ingress V2 is in an early stage, and the implementations from the providers are being worked in progress. A very rough estimate could be Q3/Q4 next year (hopefully). |
This issue is stale because it has been open for 90 days with no |
Ingress V2 is the Gateway API? |
Yes, exactly. For memo myself: Gateway API is also still under discussion - kubernetes-sigs/gateway-api#1767 |
This issue is stale because it has been open for 90 days with no |
keep |
This issue is stale because it has been open for 90 days with no |
keep |
keep |
In what area(s)?
/area networking
Describe the feature
We should enable Cross-Origin Resource Sharing (CORS) configuration in
ksvc
’s annotationsReconciler reconcile CORS info from
ksvc (annotations)
tovirtualservice
:ksvc(annotations) -> route(annotations) -> kingress( Entity spec) -> virtualservice
we can config by doing that:
config-domain
for defaultksvc
orroute
for each serviceFields included listed as follows, like istio Corspolicy
The text was updated successfully, but these errors were encountered: