-
Notifications
You must be signed in to change notification settings - Fork 351
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 etcdserver=true, newly added ApisixRoutes don't take effect after restarting the ingress-controller #2341
Comments
curl "http://10.204.222.7:9180/apisix/admin/plugin_configs/11a33fd6" -H "X-API-KEY: the route is added . |
I suspect that when etcdserver=true, it starts an in-memory etcd. After the ingress-controller restarts, the etcdserver data is lost. At the same time, after restart, the ingress-controller will batch refresh the routes in APISIX. However, since the route data in APISIX's memory is newer, the index or version refreshed to etcd is smaller, causing APISIX to not apply the latest routes |
when i change apisixroute .
below function
|
in apisix pod run this command
then run :
then i kill apisix-ingress ,the route change take effect |
Current Behavior
like #2167 ,i install apsix ingress-controller use etcdserver=true https://apisix.apache.org/blog/2023/10/18/ingress-apisix/#design-of-new-architecture ,but somtime ingress-controller can restart ,then i add route or change rout in apisixroute ,it not effect .
install apisix :
ADMIN_API_VERSION=v3
helm install apisix .
--set service.type=NodePort
--set ingress-controller.enabled=true
--create-namespace
--namespace ingress-apisix
--set ingress-controller.config.apisix.serviceNamespace=ingress-apisix
--set ingress-controller.config.apisix.adminAPIVersion=$ADMIN_API_VERSION
--set ingress-controller.config.kubernetes.enableGatewayAPI=true
--set dashboard.enabled=true
--set ingress-controller.config.etcdserver.enabled=true
then add apisixroute
please add more other apisixroute
then curl ip/get -H "host: routetest2cccc.ccc.ccc" .return 200.
then find the ingress on which k8s node ,on the k8s node exec shell kill the ingress-controller
" ps -elf | grep ingress-controller | awk '{print $4}' | xargs kill "
then change the apisixroute
curl ip/get -H "host: routenew.ccc.ccc" .return 404.
Expected Behavior
curl ip/get -H "host: routenew.ccc.ccc" .return 200.
Error Logs
apisix contoianer log
2024/12/26 06:07:13 [error] 59#59: *3033128 [lua] config_etcd.lua:193: watchdir err: has no healthy etcd endpoint available, context: ngx.timer
2024/12/26 06:07:13 [error] 51#51: *3033129 [lua] config_etcd.lua:193: watchdir err: has no healthy etcd endpoint available, context: ngx.timer
2024/12/26 06:07:13 [error] 56#56: *3033130 [lua] config_etcd.lua:193: watchdir err: has no healthy etcd endpoint available, context: ngx.timer
2024/12/26 06:07:13 [error] 54#54: *3033131 [lua] config_etcd.lua:193: watchdir err: has no healthy etcd endpoint available, context: ngx.timer
2024/12/26 06:07:16 [error] 49#49: *3033267 [lua] config_etcd.lua:193: watchdir err: has no healthy etcd endpoint available, context: ngx.timer
2024/12/26 06:07:16 [error] 52#52: *3033268 [lua] config_etcd.lua:193: watchdir err: has no healthy etcd endpoint available, context: ngx.timer
2024/12/26 06:07:16 [error] 55#55: *3033269 [lua] config_etcd.lua:193: watchdir err: has no healthy etcd endpoint available, context: ngx.timer
2024/12/26 06:07:16 [error] 53#53: *3033270 [lua] config_etcd.lua:193: watchdir err: has no healthy etcd endpoint available, context: ngx.timer
2024/12/26 06:07:16 [error] 59#59: *3033271 [lua] config_etcd.lua:193: watchdir err: has no healthy etcd endpoint available, context: ngx.timer
2024/12/26 06:07:16 [error] 50#50: *3033272 [lua] config_etcd.lua:193: watchdir err: has no healthy etcd endpoint available, context: ngx.timer
2024/12/26 06:07:16 [error] 56#56: *3033273 [lua] config_etcd.lua:193: watchdir err: has no healthy etcd endpoint available, context: ngx.timer
2024/12/26 06:07:16 [error] 51#51: *3033274 [lua] config_etcd.lua:193: watchdir err: has no healthy etcd endpoint available, context: ngx.timer
2024/12/26 06:07:16 [error] 54#54: *3033275 [lua] config_etcd.lua:193: watchdir err: has no healthy etcd endpoint available, context: ngx.timer
2024/12/26 06:07:19 [error] 49#49: *3033413 [lua] config_etcd.lua:193: watchdir err: has no healthy etcd endpoint available, context: ngx.timer
2024/12/26 06:07:19 [error] 52#52: *3033414 [lua] config_etcd.lua:193: watchdir err: has no healthy etcd endpoint available, context: ngx.timer
2024/12/26 06:07:19 [error] 53#53: *3033415 [lua] config_etcd.lua:193: watchdir err: has no healthy etcd endpoint available, context: ngx.timer
2024/12/26 06:07:19 [error] 55#55: *3033416 [lua] config_etcd.lua:193: watchdir err: has no healthy etcd endpoint available, context: ngx.timer
2024/12/26 06:07:19 [error] 59#59: *3033417 [lua] config_etcd.lua:193: watchdir err: has no healthy etcd endpoint available, context: ngx.timer
2024/12/26 06:07:19 [error] 50#50: *3033418 [lua] config_etcd.lua:193: watchdir err: has no healthy etcd endpoint available, context: ngx.timer
2024/12/26 06:07:19 [error] 56#56: *3033419 [lua] config_etcd.lua:193: watchdir err: has no healthy etcd endpoint available, context: ngx.timer
2024/12/26 06:07:19 [error] 51#51: *3033420 [lua] config_etcd.lua:193: watchdir err: has no healthy etcd endpoint available, context: ngx.timer
2024/12/26 06:07:19 [error] 54#54: *3033421 [lua] config_etcd.lua:193: watchdir err: has no healthy etcd endpoint available, context: ngx.timer
Steps to Reproduce
like #2167 ,i install apsix ingress-controller use etcdserver=true,but somtime ingress-controller can restart ,then i add route or change rout in apisixroute ,it not effect .
install apisix :
ADMIN_API_VERSION=v3
helm install apisix .
--set service.type=NodePort
--set ingress-controller.enabled=true
--create-namespace
--namespace ingress-apisix
--set ingress-controller.config.apisix.serviceNamespace=ingress-apisix
--set ingress-controller.config.apisix.adminAPIVersion=$ADMIN_API_VERSION
--set ingress-controller.config.kubernetes.enableGatewayAPI=true
--set dashboard.enabled=true
--set ingress-controller.config.etcdserver.enabled=true
then add apisixroute
please add more other apisixroute
then curl ip/get -H "host: routetest2cccc.ccc.ccc" .return 200.
then find the ingress on which node ,one the node exec shell kill the ingress-controller
" ps -elf | grep ingress-controller | awk '{print $4}' | xargs kill "
then change the apisixroute
curl ip/get -H "host: routenew.ccc.ccc" .return 404.
Environment
apisix-ingress-controller version --long
)apache/apisix-ingress-controller:1.8.0
kubectl version
)Client Version: v1.29.2
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.28.8
uname -a
)apache/apisix:3.8.1-debian
The text was updated successfully, but these errors were encountered: