现象:
E0222 09:05:53.330760 7 reflector.go:153] k8s.io/ingress-nginx/internal/ingress/controller/store/store.go:181: Failed to list *v1beta1.Ingress: the server could not find the requested resource
E0222 09:05:54.333234 7 reflector.go:153] k8s.io/ingress-nginx/internal/ingress/controller/store/store.go:181: Failed to list *v1beta1.Ingress: the server could not find the requested resource
E0222 09:05:55.334949 7 reflector.go:153] k8s.io/ingress-nginx/internal/ingress/controller/store/store.go:181: Failed to list *v1beta1.Ingress: the server could not find the requested resource
E0222 09:05:56.338249 7 reflector.go:153] k8s.io/ingress-nginx/internal/ingress/controller/store/store.go:181: Failed to list *v1beta1.Ingress: the server could not find the requested resource
E0222 09:05:57.340930 7 reflector.go:153] k8s.io/ingress-nginx/internal/ingress/controller/store/store.go:181: Failed to list *v1beta1.Ingress: the server could not find the requested resource
E0222 09:05:58.344180 7 reflector.go:153] k8s.io/ingress-nginx/internal/ingress/controller/store/store.go:181: Failed to list *v1beta1.Ingress: the server could not find the requested resource
E0222 09:05:59.346368 7 reflector.go:153] k8s.io/ingress-nginx/internal/ingress/controller/store/store.go:181: Failed to list *v1beta1.Ingress: the server could not find the requested resource
E0222 09:06:00.349861 7 reflector.go:153] k8s.io/ingress-nginx/internal/ingress/controller/store/store.go:181: Failed to list *v1beta1.Ingress: the server could not find the requested resource
E0222 09:06:01.352664 7 reflector.go:153] k8s.io/ingress-nginx/internal/ingress/controller/store/store.go:181: Failed to list *v1beta1.Ingress: the server could not find the requested resource
E0222 09:06:02.355514 7 reflector.go:153] k8s.io/ingress-nginx/internal/ingress/controller/store/store.go:181: Failed to list *v1beta1.Ingress: the server could not find the requested resource
E0222 09:06:03.358466 7 reflector.go:153] k8s.io/ingress-nginx/internal/ingress/controller/store/store.go:181: Failed to list *v1beta1.Ingress: the server could not find the requested resource
E0222 09:06:04.362685 7 reflector.go:153] k8s.io/ingress-nginx/internal/ingress/controller/store/store.go:181: Failed to list *v1beta1.Ingress: the server could not find the requested resource
E0222 09:06:05.367883 7 reflector.go:153] k8s.io/ingress-nginx/internal/ingress/controller/store/store.go:181: Failed to list *v1beta1.Ingress: the server could not find the requested resource
E0222 09:06:06.372106 7 reflector.go:153] k8s.io/ingress-nginx/internal/ingress/controller/store/store.go:181: Failed to list *v1beta1.Ingress: the server could not find the requested resource
E0222 09:06:07.376821 7 reflector.go:153] k8s.io/ingress-nginx/internal/ingress/controller/store/store.go:181: Failed to list *v1beta1.Ingress: the server could not find the requested resource
E0222 09:06:08.380451 7 reflector.go:153] k8s.io/ingress-nginx/internal/ingress/controller/store/store.go:181: Failed to list *v1beta1.Ingress: the server could not find the requested resource
E0222 09:06:09.383070 7 reflector.go:153] k8s.io/ingress-nginx/internal/ingress/controller/store/store.go:181: Failed to list *v1beta1.Ingress: the server could not find the requested resource
E0222 09:06:10.386463 7 reflector.go:153] k8s.io/ingress-nginx/internal/ingress/controller/store/store.go:181: Failed to list *v1beta1.Ingress: the server could not find the requested resource
E0222 09:06:11.389744 7 reflector.go:153] k8s.io/ingress-nginx/internal/ingress/controller/store/store.go:181: Failed to list *v1beta1.Ingress: the server could not find the requested resource
E0222 09:06:12.393492 7 reflector.go:153] k8s.io/ingress-nginx/internal/ingress/controller/store/store.go:181: Failed to list *v1beta1.Ingress: the server could not find the requested resource
E0222 09:06:13.398700 7 reflector.go:153] k8s.io/ingress-nginx/internal/ingress/controller/store/store.go:181: Failed to list *v1beta1.Ingress: the server could not find the requested resource
I0222 09:06:13.570341 7 main.go:152] Received SIGTERM, shutting down
I0222 09:06:13.570368 7 nginx.go:391] Shutting down controller queues
I0222 09:06:13.570379 7 status.go:117] updating status of Ingress rules (remove)
E0222 09:06:13.571090 7 store.go:185] timed out waiting for caches to sync
I0222 09:06:13.571168 7 nginx.go:307] Starting NGINX process
I0222 09:06:13.575738 7 leaderelection.go:242] attempting to acquire leader lease ingress-nginx/ingress-controller-leader-nginx...
I0222 09:06:13.580728 7 status.go:86] new leader elected: nginx-ingress-controller-zk6zf
E0222 09:06:13.580784 7 status.go:121] error obtaining running IPs: []
I0222 09:06:13.580792 7 nginx.go:407] Stopping NGINX process
2022/02/22 09:06:13 [notice] 34#34: signal process started
2022/02/22 09:06:13 [error] 34#34: open() "/tmp/nginx.pid" failed (2: No such file or directory)
nginx: [error] open() "/tmp/nginx.pid" failed (2: No such file or directory)
I0222 09:06:13.608432 7 main.go:156] Error during shutdown: exit status 1
I0222 09:06:13.608501 7 main.go:160] Handled quit, awaiting Pod deletion
I0222 09:06:23.609288 7 main.go:163] Exiting with 1
原因:
我的kubernetes:v1.22 不再支持v1beta1,所以与低版本的aliyuncs/nginx-ingress:0.28.0不匹配,要改成使用高版本的bitnami/nginx-ingress-controller
解决办法:
升级bitnami/nginx-ingress-controller和ingress