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 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 192.168.1.12:10254/healthz: dial tcp 192.168.1.12:10254: connect: connection refused
对应node的kubelet⽇志
systemctl status kube-proxy -l
报错如下
: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: github/kubernetes/ingress-nginx
nginx version: nginx/1.17.8
-------------------------------------------------------------------------------
W0430 09:48:42.198239 :260] SSL certificate chain completion is disabled (--enable-ssl-chain-completion=false)
W0430 09:48:42.198310 6 :543] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.
I0430 09:48:42.198533 :193] Creating API client for 10.0.0.1:443
判断是10.0.0.443有问题
node上telnet失败
exited# telnet 10.0.0.1 443
Trying 10.0.
解决⽅法,修改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即可
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论