-
Notifications
You must be signed in to change notification settings - Fork 129
Open
Labels
bugSomething isn't workingSomething isn't workingcommunityrefinedRequirements are refined and the issue is ready to be implemented.Requirements are refined and the issue is ready to be implemented.
Milestone
Description
HttpRoute creates upstream with server unix:/var/run/nginx/nginx-503-server.sock
and throws 503 error
To Reproduce
1.install nginx-gateway:
kubectl apply -f https://raw.githubusercontent.com/nginx/nginx-gateway-fabric/v1.5.1/deploy/crds.yaml
kubectl apply -f https://raw.githubusercontent.com/nginx/nginx-gateway-fabric/v1.5.1/deploy/nodeport/deploy.yaml
- Create NodePort Service
apiVersion: v1
kind: Service
metadata:
name: ufo-service
namespace: ufo-ns
spec:
type: NodePort
selector:
app: ufo-app
ports:
- protocol: TCP
name: http
port: 80
targetPort: 8000 # inside container
nodePort: 30007
- And HttpRoute
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: ufo-ns
name: ufo-httproute
spec:
parentRefs:
- name: ufo-gateway
rules:
- matches:
- path:
type: PathPrefix
value: /lol
backendRefs:
- name: ufo-service
port: 80
-
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:
$ curl http://vybory.live/lol
<html>
<head><title>503 Service Temporarily Unavailable</title></head>
<body>
<center><h1>503 Service Temporarily Unavailable</h1></center>
<hr><center>nginx</center>
</body>
</html>
- log into nginx caontainer with
kubectl exec -it --namespace nginx-gateway deployments/nginx-gateway -c nginx -- /bin/sh
- retrieve generated configuration with
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 ufo-ns_ufo-service_80 {
random two least_conn;
zone ufo-ns_ufo-service_80 512k;
server unix:/var/run/nginx/nginx-503-server.sock;
}
upstream ufo-ns_grafana_3000 {
random two least_conn;
zone ufo-ns_grafana_3000 512k;
server 10.20.15.122:3000;
}
- Also notice that at the same time, grafana
upstream
correctly references its service ip, and can be accesed via http://grafana.vybory.live
See 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
- Version of the NGINX Gateway Fabric - 1.5.1
- Version of Kubernetes: 1.29.6
- Kubernetes platform: spot.rackspace.com
- Details on how you expose the NGINX Gateway Fabric Pod : NodePort
- Logs of NGINX container: https://gist.github.com/Fak3/7bc35f3cecd38aee415046661f7982be
- NGINX Configuration: https://gist.github.com/Fak3/73abc3e2b0bdbe6c38f13c62dbc09531
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcommunityrefinedRequirements are refined and the issue is ready to be implemented.Requirements are refined and the issue is ready to be implemented.
Type
Projects
Status
🆕 New