ricardoboss / PubNet

Self-hosted Dart & Flutter package service
Apache License 2.0
22 stars 1 forks source link

Importing this on kubernetes #10

Open namanjain98 opened 3 weeks ago

namanjain98 commented 3 weeks ago

i want to deploy pubnet on kubernetes i have created certain deployment and svc but somehow registration is not getting enabled

Screenshot 2024-04-25 at 2 50 09 PM
namanjain98 commented 3 weeks ago

i have disabled the Cors from the code

image

still getting this error

image
ricardoboss commented 3 weeks ago

Hi, thanks for taking the time to file an issue!

CORS is nothing you can disable from the API-side. It's a browser feature, so every time you want to access an API from a browser (i.e. JS/WASM), you will need to configure CORS.

You can enable registrations in the appsettings.json by setting OpenRegistrations to true, like here: https://github.com/ricardoboss/PubNet/blob/72e2c7f277ce460a4efd4394a57b3ac52a4f1cf9/backend-appsettings.json#L16

namanjain98 commented 3 weeks ago

Hi @ricardoboss

This setting is already enabled And CORS is already configured

The progress is the registration page is now visible but when filling the registration form and submitting it it js giving http 405 error on the post method what can be done on that case

ricardoboss commented 3 weeks ago

That sounds like a bug in the frontend... Do you have a screenshot of the network tab for that request for me?

Can you also give me a repo and/or steps to reproduce this?

namanjain98 commented 3 weeks ago

attaching the SS for this issue

image
ricardoboss commented 3 weeks ago

Ok, and if you switch to the "Network" tab in the dev tools and select the latest failed request?

namanjain98 commented 3 weeks ago

sure attaching the SS

image
ricardoboss commented 3 weeks ago

So you're hosting this via kubernetes? Are you using a reverse proxy? Which one? How is it configured?

namanjain98 commented 3 weeks ago

description of the error

image image
namanjain98 commented 3 weeks ago

We have istio deployed in out kubernetes cluster which acts as reverse proxy and our services are present in mesh also the endpoints are exposed using virtualservice from kubernetes cluster

namanjain98 commented 3 weeks ago

can you provide any helm chart for pubnet using which we can deploy it directly on our cluster

ricardoboss commented 3 weeks ago

Sorry, I have no experience with istio, kubernetes or helm charts... From my end it looks like your cluster is blocking every request that isn't GET. Can you try reproducing the issue with the docker images or just run it locally to check?

namanjain98 commented 3 weeks ago

@ricardoboss locally it is running fine i want it specifically for kubernetes

at localhost request flow is working fine

ricardoboss commented 3 weeks ago

Sorry, I'm trying but as I said, I have no experience whatsoever with kubernetes.

Which server is sending the response? Is it Kestrel or something else?

namanjain98 commented 3 weeks ago

@ricardoboss it is not kestrel server the applications are deployed on kubernetes deployments as frontend, backend , workder as deployment and services with postgres, seq is also deployed as kubernetes deployments

ricardoboss commented 3 weeks ago

Thanks for sharing. Can you provide more info about your istio setup? I'm curious about any rules affecting HTTP methods or security features.

Also, check Istio logs for errors or warnings.

Could you try disabling istio or using another reverse proxy temporarily to see if the issue persists?

namanjain98 commented 3 weeks ago

hi @ricardoboss

replicated the same scneario in minikube cluster in local context:

after doing a port forward on localhost for frontend service it is giving the same error on registration

attachoing the screenshots for reference

image image
ricardoboss commented 3 weeks ago

Hmm... What are the values for the CORS headers? Specifically, the Access-Control-Allow-Methods header?