'Nginx Ingress on Kubernetes Cluster
`I had a working Ingress controller version 1.0.0 (Bitnami). It stopped working one fine morning, and it appeared that the error was due to the version being depricated. Now I tried to upgrade this version, but started getting errors. I delete ingress and reinstalled it again, and this time from Bitnami repo which pulled the latest image. It is throwing errors. I created a new AKS cluster and installed ingress on it from the same repo, and it seems to work perfectly fine. Can somebody help me understand how this can be fixed please? I have over 120 services running on this cluster, and starting over would mean a lot of effort and time.
E0419 10:57:29.245933 1 queue.go:130] "requeuing" err="\n-------------------------------------------------------------------------------\nError: exit status 1\n2022/04/19 10:57:29 [warn] 25#25: the \"http2_max_field_size\" directive is obsolete, use the \"large_client_header_buffers\" directive instead in /tmp/nginx-cfg2573211911:143\nnginx: [warn] the \"http2_max_field_size\" directive is obsolete, use the \"large_client_header_buffers\" directive instead in /tmp/nginx-cfg2573211911:143\n2022/04/19 10:57:29 [warn] 25#25: the \"http2_max_header_size\" directive is obsolete, use the \"large_client_header_buffers\" directive instead in /tmp/nginx-cfg2573211911:144\nnginx: [warn] the \"http2_max_header_size\" directive is obsolete, use the \"large_client_header_buffers\" directive instead in /tmp/nginx-cfg2573211911:144\n2022/04/19 10:57:29 [warn] 25#25: the \"http2_max_requests\" directive is obsolete, use the \"keepalive_requests\" directive instead in /tmp/nginx-cfg2573211911:145\nnginx: [warn] the \"http2_max_requests\" directive is obsolete, use the \"keepalive_requests\" directive instead in /tmp/nginx-cfg2573211911:145\n2022/04/19 10:57:29 [emerg] 25#25: \"location\" directive is not allowed here in /tmp/nginx-cfg2573211911:783\nnginx: [emerg] \"location\" directive is not allowed here in /tmp/nginx-cfg2573211911:783\nnginx: configuration file /tmp/nginx-cfg2573211911 test failed\n\n-------------------------------------------------------------------------------\n" key="initial-sync"
I0419 10:57:29.246021 1 event.go:282] Event(v1.ObjectReference{Kind:"Pod", Namespace:"nginx-ingress", Name:"nginx-nginx-ingress-controller-5575846679-bjwkp", UID:"9e5641ae-345c-4d3c-a840-83c143f07fd3", APIVersion:"v1", ResourceVersion:"5932936", FieldPath:""}): type: 'Warning' reason: 'RELOAD' Error reloading NGINX:
-------------------------------------------------------------------------------
Error: exit status 1
2022/04/19 10:57:29 [warn] 25#25: the "http2_max_field_size" directive is obsolete, use the "large_client_header_buffers" directive instead in /tmp/nginx-cfg2573211911:143
nginx: [warn] the "http2_max_field_size" directive is obsolete, use the "large_client_header_buffers" directive instead in /tmp/nginx-cfg2573211911:143
2022/04/19 10:57:29 [warn] 25#25: the "http2_max_header_size" directive is obsolete, use the "large_client_header_buffers" directive instead in /tmp/nginx-cfg2573211911:144
nginx: [warn] the "http2_max_header_size" directive is obsolete, use the "large_client_header_buffers" directive instead in /tmp/nginx-cfg2573211911:144
2022/04/19 10:57:29 [warn] 25#25: the "http2_max_requests" directive is obsolete, use the "keepalive_requests" directive instead in /tmp/nginx-cfg2573211911:145
nginx: [warn] the "http2_max_requests" directive is obsolete, use the "keepalive_requests" directive instead in /tmp/nginx-cfg2573211911:145
2022/04/19 10:57:29 [emerg] 25#25: "location" directive is not allowed here in /tmp/nginx-cfg2573211911:783
nginx: [emerg] "location" directive is not allowed here in /tmp/nginx-cfg2573211911:783
nginx: configuration file /tmp/nginx-cfg2573211911 test failed
Solution 1:[1]
It turns out the problem was with the ingress class name "nginx". I re-deployed the ingress controller, this time with a values file and ingressclass name as dev-nginx and this seems to resolve the issue. I then had to delete the existing ingressClass and re-deploy ingress to fix the issue.
E0421 07:40:56.183407 7 main.go:122] Unexpected error searching IngressClass: ingressclasses.networking.k8s.io "nginx" is forbidden: User "system:serviceaccount:default:ingress-nginx" cannot get resource "ingressclasses" in API group "networking.k8s.io" at the cluster scope
W0421 07:40:56.183431 7 main.go:125] No IngressClass resource with name nginx found. Only annotation will be us
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Madhav N |
