-
Notifications
You must be signed in to change notification settings - Fork 115
HttpRoute creates upstream with server unix:/var/run/nginx/nginx-503-server.sock
and throws 503 error
#3139
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
Comments
For completeness, here is grafana service: apiVersion: v1
kind: Service
metadata:
name: grafana
spec:
ports:
- port: 3000
protocol: TCP
targetPort: http-grafana
# Will be accessible at node ip which can be retieved with
# > kubectl get node -o wide
nodePort: 30008
selector:
app: grafana
sessionAffinity: None
type: NodePort and its httproute: apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: ufo-ns
name: grafana-httproute
spec:
parentRefs:
- name: ufo-gateway
hostnames:
- "grafana.vybory.live"
rules:
- matches:
- path:
type: PathPrefix
value: /
backendRefs:
- name: grafana
port: 3000 |
Hi @Fak3, the 503 server is used when we can't find any endpoints for the Service. Can you confirm that you see endpoints for the
Could be an issue with the selector labels on the Service not matching the Deployment that it's fronting. |
Endpoint is up and healthy:
|
Hm, so something is happening where the control plane is not seeing the endpoints for that service. I'd be curious if there is anything in those logs that would indicate why it's not seeing them. Are you able to check (or provide) debug logs for the |
Or even better, check the status of the |
|
https://gist.github.com/Fak3/e9f2bc418cfe3cba7966fae43ba31780 |
I've just updated this gist to have full debug log after i changed loglevel to debug and did rollout restart: |
And now, after rollout restart the httproute magically works, and my service is available. So the issue is that it does not work until you restart the nginx-gateway |
@Fak3 Definitely odd...I wonder if the endpoints weren't available at first and then were updated, and the control plane didn't see that update for some reason. That's never been an issue before, but I'm not really sure what happened in this case. Glad it's working for you now though! |
Closing for now, if this reappears consistently we can take another look. |
I hit it twice already. First on production cluster, when I reported the bug. Second time on my local kind cluster, 5 days ago. So i can reproduce it consistently. |
Hm, okay. We'll have to dig a little deeper on this. I don't see any issues in the controller logs, and it is seeing the |
This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
HttpRoute creates upstream with
server unix:/var/run/nginx/nginx-503-server.sock
and throws 503 errorTo Reproduce
1.install nginx-gateway:
check that service itself can be successfuly accessed on that node port:
curl http://vybory.live:30007
returns http 200.Attempt to access the service via nginx-gateway, notice it throws http 503:
nginx -T
and notice thatupstream
definition for myufo-service
points toserver unix:/var/run/nginx/nginx-503-server.sock;
instead of actual service ip:upstream
correctly references its service ip, and can be accesed via http://grafana.vybory.liveSee full nginx config: https://gist.github.com/Fak3/73abc3e2b0bdbe6c38f13c62dbc09531
Expected behavior
Expected: the upstream definition int the config should reference service by ip, instead of pointing to
unix:/var/run/nginx/nginx-503-server.sock
Your environment
The text was updated successfully, but these errors were encountered: