apache / apisix-ingress-controller

APISIX Ingress Controller for Kubernetes
https://apisix.apache.org/
Apache License 2.0
1.02k stars 343 forks source link

Bug: Even if apisixupstreams are bound by apisixroutes, it will prompt a large number of upstreams not found #1859

Closed jinjianming closed 1 year ago

jinjianming commented 1 year ago

Current Behavior

Create ApisixRoute and ApisixUpstream using the following example

kubectl run yages -n ingress-apisix --image smirl/yages:0.1.3 --expose --port 9000
[root@xxx~]# kubectl get ep  yages -n ingress-apisix 
NAME    ENDPOINTS          AGE
yages   10.15.0.108:9000   42h

kubectl apply -f - <<EOF
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
  name: grpc-proxy-route
  namespace: ingress-apisix
spec:
  http:
    - name: grpc-route
      match:
        hosts:
          - grpc-proxy
        paths:
          - "/*"
      backends:
      - serviceName: yages
        servicePort: 9000
        weight: 10
EOF
kubectl apply -f - <<EOF
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
  name: yages
  namespace: ingress-apisix
spec:
  scheme: grpc
EOF

At this point, ingress requests an unknown upstream API every five minutes id 91e26b21

[root@js-design-test-ack-node-10 ~]# kubectl logs apisix-ingress-controller-6584788dcb-6jdfb  -f -n ingress-apisix  |grep yages    
2023-06-12T17:29:48+08:00       warn    apisix/upstream.go:69   upstream not found      {"name": "ingress-apisix_yages_9000_service", "url": "http://apisix-admin.ingress-apisix.svc.cluster.local:9180/apisix/admin/upstreams/91e26b21", "cluster": "default"}
2023-06-12T17:34:42+08:00       warn    apisix/upstream.go:69   upstream not found      {"name": "ingress-apisix_yages_9000_service", "url": "http://apisix-admin.ingress-apisix.svc.cluster.local:9180/apisix/admin/upstreams/91e26b21", "cluster": "default"}
2023-06-12T17:39:42+08:00       warn    apisix/upstream.go:69   upstream not found      {"name": "ingress-apisix_yages_9000_service", "url": "http://apisix-admin.ingress-apisix.svc.cluster.local:9180/apisix/admin/upstreams/91e26b21", "cluster": "default"}
2023-06-12T17:44:42+08:00       warn    apisix/upstream.go:69   upstream not found      {"name": "ingress-apisix_yages_9000_service", "url": "http://apisix-admin.ingress-apisix.svc.cluster.local:9180/apisix/admin/upstreams/91e26b21", "cluster": "default"}

Expected Behavior

I hope that once apisixupstreams is bound to apisixroutes, there will be no more of these requests

Error Logs

[root@js-design-test-ack-node-10 ~]# kubectl logs apisix-ingress-controller-6584788dcb-6jdfb  -f -n ingress-apisix  |grep yages    
2023-06-12T17:29:48+08:00       warn    apisix/upstream.go:69   upstream not found      {"name": "ingress-apisix_yages_9000_service", "url": "http://apisix-admin.ingress-apisix.svc.cluster.local:9180/apisix/admin/upstreams/91e26b21", "cluster": "default"}
2023-06-12T17:34:42+08:00       warn    apisix/upstream.go:69   upstream not found      {"name": "ingress-apisix_yages_9000_service", "url": "http://apisix-admin.ingress-apisix.svc.cluster.local:9180/apisix/admin/upstreams/91e26b21", "cluster": "default"}
2023-06-12T17:39:42+08:00       warn    apisix/upstream.go:69   upstream not found      {"name": "ingress-apisix_yages_9000_service", "url": "http://apisix-admin.ingress-apisix.svc.cluster.local:9180/apisix/admin/upstreams/91e26b21", "cluster": "default"}
2023-06-12T17:44:42+08:00       warn    apisix/upstream.go:69   upstream not found      {"name": "ingress-apisix_yages_9000_service", "url": "http://apisix-admin.ingress-apisix.svc.cluster.local:9180/apisix/admin/upstreams/91e26b21", "cluster": "default"}

Steps to Reproduce

1、Create Service kubectl run yages -n ingress-apisix --image smirl/yages:0.1.3 --expose --port 9000 2、Publish ApisixRoute and ApisixUpstream

kubectl apply -f - <<EOF
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
  name: grpc-proxy-route
  namespace: ingress-apisix
spec:
  http:
    - name: grpc-route
      match:
        hosts:
          - grpc-proxy
        paths:
          - "/*"
      backends:
      - serviceName: yages
        servicePort: 9000
        weight: 10
EOF
kubectl apply -f - <<EOF
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
  name: yages
  namespace: ingress-apisix
spec:
  scheme: grpc
EOF

3、Repeat requests every five minutes apisix

Environment

tao12345666333 commented 1 year ago

I believe the logs you see are unrelated to your specific testing and scenario. These are some warning logs that are related to our current implementation.

jinjianming commented 1 year ago

我相信您看到的日志与您的特定测试和场景无关。 这些是与我们当前实施相关的一些警告日志。 @tao12345666333 If it only outputs logs, I don't really care. It mainly sends requests to Apisix, and I create many ApisixRoutes and ApisixUpstreams at the same time, worrying about affecting Apisix performance stability or security issues;

github-actions[bot] commented 1 year ago

This issue has been marked as stale due to 90 days of inactivity. It will be closed in 30 days if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.

github-actions[bot] commented 1 year ago

This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.