k8s部署ingress-nginx报错拍错

  不是ingress-Nginx不成功出现错误提示

kubectl describe pod nginx-ingress-controller-6ffc8fdf96-xtg6n -n ingress-Nginx

 

 normal   Scheduled  <unkNown>         default-scheduler      Successfully assigned ingress-Nginx/nginx-ingress-controller-6ffc8fdf96-xtg6n to 192.168.1.12
  normal   Pulled     21s               kubelet, 192.168.1.12  Container image "quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.30.0" already present on machine
  normal   Created    21s               kubelet, 192.168.1.12  Created container nginx-ingress-controller
  normal   Started    20s               kubelet, 192.168.1.12  Started container nginx-ingress-controller
  Warning  Unhealthy  5s (x2 over 15s)  kubelet, 192.168.1.12  Readiness probe Failed: Get http://192.168.1.12:10254/healthz: dial tcp 192.168.1.12:10254: connect: connection refused
  Warning  Unhealthy  2s                kubelet, 192.168.1.12  Liveness probe Failed: Get http://192.168.1.12:10254/healthz: dial tcp 192.168.1.12:10254: connect: connection refused

   对应node的kubelet日志

systemctl status kube-proxy -l

   报错如下

kuberuntime_container.go:490] preStop hook for container "nginx-ingress-controller" Failed: command '/wait-shutdown' exited with 137:

 

 

 

 

   查看pod日志

# kubectl logs nginx-ingress-controller-6ffc8fdf96-xtg6n -n ingress-Nginx
-------------------------------------------------------------------------------
Nginx Ingress controller
  Release:       0.30.0
  Build:         git-7e65b90c4
  Repository:    https://github.com/kubernetes/ingress-Nginx
  Nginx version: Nginx/1.17.8

-------------------------------------------------------------------------------

W0430 09:48:42.198239       6 flags.go:260] SSL certificate chain completion is disabled (--enable-ssl-chain-completion=false)
W0430 09:48:42.198310       6 client_config.go:543] Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.
I0430 09:48:42.198533       6 main.go:193] Creating API client for https://10.0.0.1:443

   判断是10.0.0.443有问题

  node上telnet失败

# telnet 10.0.0.1 443
Trying 10.0.0.1...

   解决方法修改kube-proxy配置把流量转发该成ipvs模式

cat /opt/kubernetes/cfg/kube-proxy

 

# cat /opt/kubernetes/cfg/kube-proxy
KUBE_PROXY_OPTS="--logtostderr=false \
--log-dir=/opt/kubernetes/logs/kube-proxy \
--v=4 \
--hostname-override=192.168.1.12 \
--cluster-cidr=10.0.0.0/24 \
--proxy-mode=ipvs \
--masquerade-all=true \
--kubeconfig=/opt/kubernetes/cfg/kube-proxy.kubeconfig"

   增加内容

 

   重启kube-proxy

  重新不是ingress-Nginx即可

相关文章

Nginx (engine x) 是一个高性能的HTTP和反向代理服务,也是一...
本地项目配置 1 复制 luffy/settings/dev.py为prop.py 修改l...
nginx不仅可以隐藏版本信息,还支持自定义web服务器信息 先看...
一 、此次漏洞分析 1 nginx HTTP/2漏洞 [nginx-announce] ng...
###进入nginx 目录cd /usr/local/nginx###递归显示 2 级目录...
在cmd命令窗口输入下面命令进行查看 tasklist /fi "ima...