我在裸机CentOS上设置了一个Kubernetes集群v1.22.1
。我在按照此链接中的操作步骤1-3安装Nginx Ingress控制器时遇到问题。
我按照步骤进行操作,但是nginx ingress控制器pod出现了CrashLoopBackOff
错误。我查看了pod的日志并发现如下信息:
[root@dev1 deployments]# kubectl logs -n nginx-ingress nginx-ingress-5cd5c7549d-hw6l7
I0910 23:15:20.729196 1 main.go:271] Starting NGINX Ingress controller Version=1.12.1 GitCommit=6f72db6030daa9afd567fd7faf9d5fffac9c7c8f Date=2021-09-08T13:39:53Z PlusFlag=false
W0910 23:15:20.770569 1 main.go:310] The '-use-ingress-class-only' flag will be deprecated and has no effect on versions of kubernetes >= 1.18.0. Processing ONLY resources that have the 'ingressClassName' field in Ingress equal to the class.
F0910 23:15:20.774788 1 main.go:314] Error when getting IngressClass nginx: the server could not find the requested resource
我相信我已经按照下面的方式正确设置了IngressClass:
[root@dev1 deployments]# kubectl get IngressClass
NAME CONTROLLER PARAMETERS AGE
nginx nginx.org/ingress-controller <none> 2m12s
所以我不知道为什么在获取IngressClass nginx时出现错误。请问有人能帮我理一理吗?