-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: When k8s service is deleted, the APISIX Upstream nodes field is not cleared #674
Comments
This is a known behavior, see
From the proxy point of view, the result is similar, requests will be failed no matter whether we clean the nodes. Of course, we do need to make some reactions for the Services/Endpoints delete events, PR's welcome to optimize it. |
There will be problems in special scenarios: the node ip is allocated by other containers. |
Fair enough, PR's welcome to fix this. |
Thanks for your feedback, it is not difficult to fix it, welcome to submit a PR |
I hope this can have an overall solution and then coding. Upstream management in the ingress controller has become more complicated, it will be affected in many ways,for example, the resources of k8s svc , ApisixUpstream and ApisixRoute ,There are subset-related configurations in ApisixRoute and ApisixUpstream. |
It doesn't affect ApisixRoute, but it will affect multiple Upstream objects in APISIX due to subset mechanics. |
I'm trying to solve this problem, I have two implementation schemes, which need to be confirmed:
I prefer the first, any better proposal? |
@AlinsRan thanks. Currently we use the following methods to generate the upstream name. apisix-ingress-controller/pkg/types/apisix/v1/types.go Lines 425 to 450 in 49dd015
Then generate its ID. apisix-ingress-controller/pkg/id/idgen.go Lines 25 to 39 in 49dd015
Maintaining the mapping relationship between Service and Upstream, I think it is a better choice. Here we need to clear the node field of Upstream in APISIX after discovering that the service has been deleted |
I understand, After the SVC is deleted, it should also be written to The question is how to maintain this relationship. |
#1064 has been merged. I will close this one. thanks |
Issue description
When k8s service is deleted, the APISIX Upstream nodes field is not cleared
Environment
Minimal test code / Steps to reproduce the issue
What's the actual result? (including assertion message & call stack if applicable)
remaining history of upstream node
What's the expected result?
upstream nodes cleared
The text was updated successfully, but these errors were encountered: