apache / apisix-ingress-controller

APISIX Ingress Controller for Kubernetes
https://apisix.apache.org/
Apache License 2.0
996 stars 340 forks source link

request help: user ingressClass, modify the ingressClassof the route, and the old route does not become invalid. #2231

Closed VanLiuZhi closed 1 week ago

VanLiuZhi commented 4 months ago

Issue description

I have deployed two Ingresses, and I am now using the ingressClass to publish routes to two controllers, now everything is fine.

If I change the ingressClass of route A to the same as route B, both Ingresses will have this record, which means that route A will not delete it.

route A

apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
  name: apisix-dashboard-rd
  namespace: ingress-apisix
spec:
  ingressClassName: apisix-rd
  http:
    - backends:
        - serviceName: apisix-dashboard
          servicePort: 80
      match:
        hosts:
          - apisix-admin-rd.test.com
        paths:
          - /*
      name: route

route B

apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
  name: apisix-dashboard
  namespace: ingress-apisix
spec:
  ingressClassName: apisix
  http:
    - backends:
        - serviceName: apisix-dashboard
          servicePort: 80
      match:
        hosts:
          - apisix-admin.test.com
        paths:
          - /*
      name: route

The general workflow;

routeA  => ingressClassName: apisix-rd
routeB  => ingressClassName: apisix
ingressA route list => [ apisix-dashboard-rd ]
ingressB route list => [ apisix-dashboard ]

change routeA:

routeA  => ingressClassName: apisix
routeB  => ingressClassName: apisix
ingressA route list => [ apisix-dashboard-rd]
ingressB route list => [ apisix-dashboard, apisix-dashboard-rd]

I suspect that there is a data synchronization issue. After adjusting the synchronization parameters:

kubernetes:
  kubeconfig: ""
  resync_interval: "60s"

I found that the route information remains unchanged after the data is updated.

Is it designed this way, or is it a bug?

Environment

apisix-ingress-controller version: 1.7.1 Kubernetes: 1.26.10 apisix: 3.8.0 linux: 4.18.0 x86_64

github-actions[bot] commented 1 month 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 week 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.