ingress 创建没有指定ingressClassName ,配置没有加载进去,为什么也可以访问,哪还有nginx,-controller 干什么
时间: 2024-03-04 21:49:49 浏览: 20
即使您没有指定 ingressClassName,Kubernetes 仍然会将 Ingress 配置加载到集群中。这是因为 Kubernetes Ingress Controller 会监视 Kubernetes API 服务器上的 Ingress 资源,并根据这些资源创建和配置负载均衡器(如 Nginx)。因此,即使您没有指定 ingressClassName,Ingress Controller(如 Nginx Controller)仍然会将配置加载到负载均衡器中,并使其工作。
Nginx 和 Nginx Controller 都是用于处理 Ingress 资源的常用工具。Nginx 是一个高性能的 Web 服务器,它可以用作 Ingress 资源的反向代理。而 Nginx Controller 则是一个 Kubernetes 控制器,它可以自动配置 Nginx 负载均衡器,以处理 Ingress 资源和服务之间的流量路由。因此,Nginx Controller 的作用是将 Kubernetes Ingress 资源转换为 Nginx 配置,并将其应用于 Nginx 负载均衡器。
相关问题
从哪里可以下载ingress-nginx-controller镜像
你可以从 Docker Hub 上下载 ingress-nginx-controller 镜像。你可以使用以下命令来拉取最新版本的镜像:
```
docker pull quay.io/kubernetes-ingress-controller/nginx-ingress-controller:latest
```
如果你想要下载特定版本的镜像,可以将 `latest` 替换为所需的版本号。此外,你还可以在 ingress-nginx 的 GitHub 仓库中找到镜像的发布版本和相关文档。
Back-off restarting failed container controller in pod ingress-nginx-controller-
Back-off restarting failed container controller in pod ingress-nginx-controller通常是由于ingress-nginx控制器在启动过程中遇到了问题而导致的。根据提供的引用内容,可以看到在部署之后,容器的状态一直处于CrashLoopBackOff状态,表示容器在启动后立即崩溃并尝试重新启动。
解决此问题的一种方法是重新部署ingress-nginx。通过引用中的命令"kubectl get pod -n ingress-nginx",我们可以看到ingress-nginx的另一个实例已经成功运行。因此,可以尝试删除当前的ingress-nginx pod并重新部署。
另外,通过引用中的命令"kubectl logs nginx-ingress-controller-7bbb744996-rd9d6 -n ingress-nginx",我们可以查看容器的日志。这些日志可能会提供有关容器启动失败的更多详细信息。
解决问题的步骤如下:
1. 使用命令"kubectl delete pod -n ingress-nginx nginx-ingress-controller-7bbb744996-rd9d6"删除当前的ingress-nginx pod。
2. 使用命令"kubectl get pod -n ingress-nginx"确保pod已成功删除。
3. 使用命令"kubectl apply -f <ingress-nginx配置文件>"重新部署ingress-nginx。可以使用之前的配置文件或从官方GitHub仓库中获取最新的配置文件。
4. 使用命令"kubectl get pod -n ingress-nginx"检查新的ingress-nginx pod的状态是否为Running。
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)