apisix-ingress-controller
apisix-ingress-controller copied to clipboard
help request: the ApisixRoute resource does not create route
Description
the nginx-service:
$ kds -n apisix nginx-service
Name: nginx-service
Namespace: apisix
Labels: app=nginx
Annotations: cloud.google.com/neg: {"ingress":true}
Selector: app=nginx
Type: ClusterIP
IP Family Policy: SingleStack
IP Families: IPv4
IP: 34.118.230.159
IPs: 34.118.230.159
Port: <unset> 80/TCP
TargetPort: 80/TCP
Endpoints: 10.163.33.29:80,10.163.34.28:80
Session Affinity: None
Internal Traffic Policy: Cluster
the ApisixRoute resource:
$ k describe apisixroute -n apisix nginx
Name: nginx
Namespace: apisix
Labels: <none>
Annotations: <none>
API Version: apisix.apache.org/v2
Kind: ApisixRoute
Metadata:
Creation Timestamp: 2026-02-06T07:41:27Z
Generation: 2
Resource Version: 1770364761781807008
UID: 6222e5e9-60d8-447a-a064-9d9c0c1ae848
Spec:
Http:
Backends:
Service Name: nginx-service
Service Port: 80
Match:
Hosts:
xiaom-1.bblops.com
Paths:
/aaa
Name: nginx
the apisix-ingress-controller log:
2026-02-06T07:53:26.889Z DEBUG provider apisix/provider.go:192 deleting object {"object": {"kind":"ApisixRoute","apiVersion":"apisix.apache.org/v2","metadata":{"name":"nginx","namespace":"apisix","uid":"6222e5e9-60d8-447a-a064-9d9c0c1ae848","resourceVersion":"1770363687261903008","generation":1,"creationTimestamp":"2026-02-06T07:41:27Z","annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"apisix.apache.org/v2\",\"kind\":\"ApisixRoute\",\"metadata\":{\"annotations\":{},\"name\":\"nginx\",\"namespace\":\"apisix\"},\"spec\":{\"http\":[{\"backends\":[{\"serviceName\":\"nginx-service\",\"servicePort\":80}],\"match\":{\"hosts\":[\"xiaom-1.bblops.com\"],\"paths\":[\"/\"]},\"name\":\"nginx\"}]}}\n"},"managedFields":[{"manager":"kubectl-client-side-apply","operation":"Update","apiVersion":"apisix.apache.org/v2","time":"2026-02-06T07:41:27Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:annotations":{".":{},"f:kubectl.kubernetes.io/last-applied-configuration":{}}},"f:spec":{".":{},"f:http":{".":{},"k:{\"name\":\"nginx\"}":{".":{},"f:backends":{},"f:match":{".":{},"f:hosts":{},"f:paths":{}},"f:name":{}}}}}}]},"spec":{"http":[{"name":"nginx","match":{"paths":["/"],"hosts":["xiaom-1.bblops.com"]},"backends":[{"serviceName":"nginx-service","servicePort":80,"weight":null}],"websocket":null,"authentication":{"enable":false,"type":"","keyAuth":{},"jwtAuth":{},"ldapAuth":{}}}]},"status":{}}}
2026-02-06T07:53:26.889Z INFO readiness readiness/manager.go:163 marking resource as done {"gvk": "apisix.apache.org/v2, Kind=ApisixRoute", "name": {"name":"nginx","namespace":"apisix"}, "state_count": 0}
Environment
- APISIX version (run
apisix version): 3.14.1 - apisix-ingress-controller: 2.0.1
I found the reason; I need to add the configuration ingressClassName: apisix to the ApisixRoute resource.