Kubernetes访问报错: No route to host
程序员文章站
2024-03-13 23:53:04
...
背景
搭建完集群式k8s后,各个节点都已经Ready,但是在创建echo服务进行访问时报错:No route to host
解决
参考链接:https://imlc.me/v/zh-cn/kuai-su-jie-jue-kubernetes-no-route-to-host
(一)集群式部署
[[email protected] kong]# systemctl stop kubelet
[[email protected] kong]# systemctl stop docker
[[email protected] kong]# iptables --flush
[[email protected] kong]# iptables -tnat --flush
[[email protected] kong]# systemctl start kubelet
[[email protected] kong]# systemctl start docker
(二)Microk8s部署
[[email protected] kong]# microk8s stop
[[email protected] kong]# systemctl stop docker
[[email protected] kong]# iptables --flush
[[email protected] kong]# iptables -tnat --flush
[[email protected] kong]# systemctl start docker
[[email protected] kong]# microk8s start
测试
[[email protected] kong]# kubectl get svc -n demo -o wide
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
echo ClusterIP 10.105.104.233 <none> 8080/TCP,80/TCP 26m app=echo
[[email protected] kong]# curl http://10.105.104.233
Hostname: echo-8467949b65-mt4vk
Pod Information:
node name: k8s-worker-1
pod name: echo-8467949b65-mt4vk
pod namespace: demo
pod IP: 10.36.0.0
Server values:
server_version=nginx: 1.13.3 - lua: 10008
Request Information:
client_address=10.32.0.1
method=GET
real path=/
query=
request_version=1.1
request_scheme=http
request_uri=http://10.105.104.233:8080/
Request Headers:
accept=*/*
host=10.105.104.233
user-agent=curl/7.29.0
Request Body:
-no body in request-
上一篇: Sprintboot redis 采用gzip和Snappy compress压缩数据
下一篇: Unable to connect to the server: dial tcp 192.168.0.132:16443: connect: no route to host解决
推荐阅读
-
docker 互相访问出现 No route to host 博客分类: docker
-
docker 互相访问出现 No route to host 博客分类: docker
-
centos8: 执行 telnet ip port 报错 No route to host
-
mount报错failed: No route to host
-
Kubernetes访问报错: No route to host
-
no route to host (docker 容器访问宿主机)
-
Docker问题:容器互连时访问宿主机出现“No route to host”的问题
-
docker访问宿主机:No route to host (Host unreachable)
-
BUG:Could not connect to Redis No route to host(redis集群报错)
-
redhat(12)- 访问网络时,出错 port 80 no route to host