ingress-gce
ingress-gce copied to clipboard
How to enable Access-Control-Allow-Origin from gce-ingress
We are facing an error related of CORS policy:
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Is there any way to allow it from gce-ingress annotations ?
Please help.
Can you elaborate where did you get this error? When sending traffic to the ingress VIP?
/triage needs-information
NGINX ingress allows you to do this...
annotations:
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/cors-allow-origin: "www.example.com"
Is there an equivalent for the gce-ingress? I can't find any security features on it, the ingress is accessible to anyone externally.
/kind feature
+1
+1 :)
+1
Work to allow users to specify custom response headers using the BackendConfig is in progress. I will update this ticket again once it it is available in GKE.
+1
Custom response headers can now be configured through the BackendConfig CRD. This feature is available for new GKE 1.25+ clusters.
dup #1106
I see that 1106 has been closed out, but it's unclear how this can be achieved as I'm not really seeing any documentation or examples for this new feature. Can anyone provide me an example so I don't have to check the box in the IAP console?
(apologies for the repost, I deleted for a period where I convinced myself that my issues something else)
Custom response headers can now be configured through the BackendConfig CRD. This feature is available for new GKE 1.25+ clusters.
dup #1106
Hi @swetharepakula, it appears this isn't documented yet here ? Is this definitely GA ? There's only a mention of request (not response) headers. Thanks.
That is correct the field is not yet documented, but the field should be available for 1.25+ clusters.
We will work to update GKE public docs