在原生 Kubernetes 上配置 Ingress 控制器

在原生 Kubernetes 上配置 Ingress 控制器

我正在尝试在 Kubernetes v1.29.2 上实现本教程中的解决方案:

https://platform9.com/learn/v1.0/tutorials/nginix-controller-helm

我跑:

root@node1:~# helm repo add nginx-stable https://helm.nginx.com/stable
"nginx-stable" has been added to your repositories
root@node1:~# helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "nginx-stable" chart repository
Update Complete. ⎈Happy Helming!⎈
root@node1:~# helm install nginx-ingress nginx-stable/nginx-ingress --set rbac.create=true
NAME: nginx-ingress
LAST DEPLOYED: Wed Mar 27 15:00:56 2024
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
NGINX Ingress Controller 3.5.0 has been installed.

For release notes for this version please see: https://docs.nginx.com/nginx-ingress-controller/releases/

Installation and upgrade instructions: https://docs.nginx.com/nginx-ingress-controller/installation/installing-nic/installation-with-helm/
root@node1:~# kubectl get pods --all-namespaces -l app=nginx-ingress-nginx-ingress
No resources found
root@node1:~#
root@node1:~# kubectl get pods --all-namespaces -l app=nginx-ingress-nginx-ingress
No resources found
root@node1:~#
root@node1:~# kubectl get services nginx-ingress-nginx-ingress
Error from server (NotFound): services "nginx-ingress-nginx-ingress" not found
root@node1:~#
root@node1:~# kubectl get pods
NAME                                                       READY   STATUS    RESTARTS   AGE
nginx-ingress-controller-55b595c97-ljtlh                   1/1     Running   0          37m
root@node1:~#
root@node1:~#  kubectl logs nginx-ingress-controller-55b595c97-ljtlh
NGINX Ingress Controller Version=3.5.0 Commit=2c2fba3bda3b1bdc76455125031308fda3cc4eab Date=2024-03-20T09:55:44Z DirtyState=false Arch=linux/amd64 Go=go1.22.1
I0327 15:01:13.818970       1 flags.go:316] Starting with flags: ["-nginx-plus=false" "-nginx-reload-timeout=60000" "-enable-app-protect=false" "-enable-app-protect-dos=false" "-nginx-configmaps=default/nginx-ingress" "-ingress-class=nginx" "-health-status=false" "-health-status-uri=/nginx-health" "-nginx-debug=false" "-v=1" "-nginx-status=true" "-nginx-status-port=8080" "-nginx-status-allow-cidrs=127.0.0.1" "-report-ingress-status" "-external-service=nginx-ingress-controller" "-enable-leader-election=true" "-leader-election-lock-name=nginx-ingress-leader" "-enable-prometheus-metrics=true" "-prometheus-metrics-listen-port=9113" "-prometheus-tls-secret=" "-enable-service-insight=false" "-service-insight-listen-port=9114" "-service-insight-tls-secret=" "-enable-custom-resources=true" "-enable-snippets=false" "-include-year=false" "-disable-ipv6=false" "-enable-tls-passthrough=false" "-enable-cert-manager=false" "-enable-oidc=false" "-enable-external-dns=false" "-default-http-listener-port=80" "-default-https-listener-port=443" "-ready-status=true" "-ready-status-port=8081" "-enable-latency-metrics=false" "-ssl-dynamic-reload=true" "-enable-telemetry-reporting=true" "-weight-changes-dynamic-reload=false"]
I0327 15:01:13.833782       1 main.go:273] Kubernetes version: 1.29.2
I0327 15:01:13.851672       1 main.go:418] Using nginx version: nginx/1.25.4
I0327 15:01:13.912151       1 main.go:839] Pod label updated: nginx-ingress-controller-55b595c97-ljtlh
2024/03/27 15:01:13 [notice] 16#16: using the "epoll" event method
2024/03/27 15:01:13 [notice] 16#16: nginx/1.25.4
2024/03/27 15:01:13 [notice] 16#16: built by gcc 12.2.0 (Debian 12.2.0-14)
2024/03/27 15:01:13 [notice] 16#16: OS: Linux 6.1.0-9-cloud-amd64
2024/03/27 15:01:13 [notice] 16#16: getrlimit(RLIMIT_NOFILE): 65535:65535
2024/03/27 15:01:13 [notice] 16#16: start worker processes
2024/03/27 15:01:13 [notice] 16#16: start worker process 17
2024/03/27 15:01:13 [notice] 16#16: start worker process 18
I0327 15:01:13.923049       1 listener.go:48] Starting prometheus listener on: :9113/metrics
2024/03/27 15:01:13 [notice] 16#16: start worker process 19
2024/03/27 15:01:13 [notice] 16#16: start worker process 21
I0327 15:01:13.925612       1 leaderelection.go:250] attempting to acquire leader lease default/nginx-ingress-leader...
2024/03/27 15:01:13 [notice] 16#16: start worker process 22
2024/03/27 15:01:13 [notice] 16#16: start worker process 23
I0327 15:01:13.970775       1 leaderelection.go:260] successfully acquired lease default/nginx-ingress-leader
2024/03/27 15:01:14 [notice] 16#16: signal 1 (SIGHUP) received from 27, reconfiguring
2024/03/27 15:01:14 [notice] 16#16: reconfiguring
2024/03/27 15:01:14 [notice] 16#16: using the "epoll" event method
2024/03/27 15:01:14 [notice] 16#16: start worker processes
2024/03/27 15:01:14 [notice] 16#16: start worker process 28
2024/03/27 15:01:14 [notice] 16#16: start worker process 29
2024/03/27 15:01:14 [notice] 16#16: start worker process 30
2024/03/27 15:01:14 [notice] 16#16: start worker process 31
2024/03/27 15:01:14 [notice] 16#16: start worker process 32
2024/03/27 15:01:14 [notice] 16#16: start worker process 33
2024/03/27 15:01:14 [notice] 18#18: gracefully shutting down
2024/03/27 15:01:14 [notice] 23#23: gracefully shutting down
2024/03/27 15:01:14 [notice] 22#22: gracefully shutting down
2024/03/27 15:01:14 [notice] 23#23: exiting
2024/03/27 15:01:14 [notice] 21#21: gracefully shutting down
2024/03/27 15:01:14 [notice] 19#19: gracefully shutting down
2024/03/27 15:01:14 [notice] 19#19: exiting
2024/03/27 15:01:14 [notice] 22#22: exiting
2024/03/27 15:01:14 [notice] 22#22: exit
2024/03/27 15:01:14 [notice] 19#19: exit
2024/03/27 15:01:14 [notice] 23#23: exit
2024/03/27 15:01:14 [notice] 21#21: exiting
2024/03/27 15:01:14 [notice] 21#21: exit
2024/03/27 15:01:14 [notice] 18#18: exiting
2024/03/27 15:01:14 [notice] 18#18: exit
2024/03/27 15:01:14 [notice] 17#17: gracefully shutting down
2024/03/27 15:01:14 [notice] 17#17: exiting
2024/03/27 15:01:14 [notice] 17#17: exit
I0327 15:01:14.303262       1 event.go:364] Event(v1.ObjectReference{Kind:"ConfigMap", Namespace:"default", Name:"nginx-ingress", UID:"5e1951c2-d096-4480-a40b-3ebfc981f1e2", APIVersion:"v1", ResourceVersion:"3617113", FieldPath:""}): type: 'Normal' reason: 'Updated' Configuration from default/nginx-ingress was updated
2024/03/27 15:01:14 [notice] 16#16: signal 17 (SIGCHLD) received from 22
2024/03/27 15:01:14 [notice] 16#16: worker process 22 exited with code 0
2024/03/27 15:01:14 [notice] 16#16: signal 29 (SIGIO) received
2024/03/27 15:01:14 [notice] 16#16: signal 17 (SIGCHLD) received from 21
2024/03/27 15:01:14 [notice] 16#16: worker process 17 exited with code 0
2024/03/27 15:01:14 [notice] 16#16: worker process 21 exited with code 0
2024/03/27 15:01:14 [notice] 16#16: signal 29 (SIGIO) received
2024/03/27 15:01:14 [notice] 16#16: signal 17 (SIGCHLD) received from 18
2024/03/27 15:01:14 [notice] 16#16: worker process 18 exited with code 0
2024/03/27 15:01:14 [notice] 16#16: signal 29 (SIGIO) received
2024/03/27 15:01:14 [notice] 16#16: signal 17 (SIGCHLD) received from 19
2024/03/27 15:01:14 [notice] 16#16: worker process 19 exited with code 0
2024/03/27 15:01:14 [notice] 16#16: signal 29 (SIGIO) received
2024/03/27 15:01:14 [notice] 16#16: signal 17 (SIGCHLD) received from 23
2024/03/27 15:01:14 [notice] 16#16: worker process 23 exited with code 0
2024/03/27 15:01:14 [notice] 16#16: signal 29 (SIGIO) received
E0327 15:07:01.756789       1 leaderelection.go:332] error retrieving resource lock default/nginx-ingress-leader: etcdserver: leader changed
I0327 15:07:03.283380       1 leaderelection.go:285] failed to renew lease default/nginx-ingress-leader: timed out waiting for the condition
root@node1:~#

您知道为什么我的入口控制器是空的吗?

相关内容