-
Notifications
You must be signed in to change notification settings - Fork 28
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
Unable to properly route when using K8S #154
Comments
Interestingly if I run just a temporary alpine container and curl the backend service it works perfectly fine. |
Hi, In my Kubernetes cluster, all containers are deployed with a ClusterIP type. I also use a reverse proxy though, which may be why mine works? Here's my frontend service
Then my ingress controller which handle reverse proxying using ingress-nginx
Then for the config map, the
I'm not the most knowledge with Kubernetes so I may be missing your point and issue. Let me know if this helps. |
Yes this would probably work, since you are basically exposing your service to the net (kind-of) and routing trafik through your dns resolver. So it doesn't actually use the local k8s service connection. Kind of like instead of going to the neighbour to deliver a letter, you send it through the post. It works, but it's more work. This would probably also work for me, but would prefer to keep it local only. I don't know React good enough to know why it behaves like this to help out tho. (Take everything I said with a grain of salt, I'm working on intuition here :D ) |
The reverse proxy is available only locally. I have a dns record set to |
I'm having a weird problem when trying to use this in my K8S cluster. The frontend can never communicate with the backend when using the service name or even cluster ip of the backend service. I get either NS_ERROR_UNKOWN_HOST or NS_ERROR_BAD_URI errors. However if I switch my backend service from ClusterIP to LoadBalancer and use that IP, it works fine.
The issue here is that I cannot hardcode the loadbalancer IP into my config since it could change depending on the whims of MetalLB. So I need the frontend to be able to resolve the dns name instead of only IP.
I don't know if this is an issue with the implementation or what, but I'm all out of ideas, have spent the last day or two trying to make it work. I'll attach my K8S files under that I use for deployment. (No reverse-proxy, local only)
Main deployment file
Backend config
Frontend config
Nginx config
The text was updated successfully, but these errors were encountered: