Open liuzhiyong1982 opened 1 year ago
Did you configure the service_name in the following format?
function: nodes(service_name)
description: nodes() function attempts to look up the ngx.shared.DICT for nodes corresponding to servicename, \ servicename should match pattern: [namespace]/[name]:[portName]
ref: https://apisix.apache.org/docs/apisix/discovery/kubernetes/#single-cluster-mode-query-interface
@shreemaan-abhishek , yes, I am using the right serivce_name format in apisix upstream setting.
@liuzhiyong1982 have you solved your problem?
want help also, meeting the same issue
I just got stuck with this same issue. I managed to resolve this by using the port name defined for this service (http in my instance) as oppose to the port number ( 80 in your example above). I hope this helps :)
Snippet from the service definition: spec: ports:
From the manual:
met the same issue, the service not be set port name, then trying to use the port number, I get the same error log:
2024/05/16 09:14:23 [error] 386#386: *7955311 [lua] init.lua:548: handle_upstream(): failed to set upstream: no valid upstream node: nil, client: 10.77.101.0, server: _, request: "POST /xxx
additional: I set another route for a service which has port name, that succeed
met the same issue, the service not be set port name, then trying to use the port number, I get the same error log:
2024/05/16 09:14:23 [error] 386#386: *7955311 [lua] init.lua:548: handle_upstream(): failed to set upstream: no valid upstream node: nil, client: 10.77.101.0, server: _, request: "POST /xxx
additional: I set another route for a service which has port name, that succeed
use target port number instead port number, fixed
pls give example format for this target port number instead port number
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
name: httpbin-upstream
namespace: default
spec:
loadbalancer:
type: ewma
discovery:
type: kubernetes
serviceName: default/httpbin:http
that way works for me.
Description
I deployed the APISIX from official Helm apisix chart v2.2.0. Below image is the overlay values for enabling Kubernetes service discovery.
what I have done:
however, I still got 503 when I attempt to open the site and was told 'failed to set upstream: no valid upstream node: nil'
Did I missed something?
Environment
apisix version
): apache/apisix:3.5.0-debianuname -a
): Azure Kubernetes Serviceopenresty -V
ornginx -V
): nginx version: openresty/1.21.4.2