ingress访问不到对应的pod

来源:6-6 部署ingress-nginx(下)

刘莅轩

2019-09-20

[root@k8s-master-01 ingress-nginx]# kubectl get all -n ingress-nginx
NAME                                            READY   STATUS    RESTARTS   AGE
pod/default-http-backend-c858dffd-dcs9x         1/1     Running   0          26s
pod/nginx-ingress-controller-598c6d8987-wznxx   1/1     Running   0          26s


NAME                           TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)   AGE
service/default-http-backend   ClusterIP   10.254.158.137   <none>        80/TCP    26s


NAME                                       READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/default-http-backend       1/1     1            1           26s
deployment.apps/nginx-ingress-controller   1/1     1            1           26s

NAME                                                  DESIRED   CURRENT   READY   AGE
replicaset.apps/default-http-backend-c858dffd         1         1         1       26s
replicaset.apps/nginx-ingress-controller-598c6d8987   1         1         1       26s
[root@k8s-master-01 ingress-nginx]# kubectl get pod -o wide
NAME                           READY   STATUS    RESTARTS   AGE   IP            NODE            NOMINATED NODE   READINESS GATES
nginx                          1/1     Running   0          43h   128.22.0.3    k8s-worker-02   <none>           <none>
nginx-ds-bmsm9                 1/1     Running   0          43h   128.22.0.2    k8s-worker-02   <none>           <none>
nginx-ds-xz2xg                 1/1     Running   3          43h   128.22.1.11   k8s-worker-01   <none>           <none>
tomcat-demo-7c8ccf9fcd-vgvjd   1/1     Running   0          14s   128.22.1.29   k8s-worker-01   <none>           <none>

配置host后访问报504

[root@k8s-worker-02 harbor]# netstat -ntpl|grep 443
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      24716/nginx: master 
tcp6       0      0 :::443                  :::*                    LISTEN      24716/nginx: master 
[root@k8s-worker-02 harbor]# netstat -ntpl|grep 80
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      24716/nginx: master 
tcp        0      0 0.0.0.0:18080           0.0.0.0:*               LISTEN      24716/nginx: master 
tcp6       0      0 :::80                   :::*                    LISTEN      24716/nginx: master 
tcp6       0      0 :::18080                :::*                    LISTEN      24716/nginx: master 

我用最新版的mandatory.yaml访问报503,日志显示已经Type:“ContainerStarted”

求老师教下排查思路

写回答

1回答

刘莅轩

提问者

2019-09-20

ingress与pod是不是得在一个worker节点上,我部署在同一节点就正常了

0
1
刘果国
恩 那跟ingress没关系了,基本是cni的问题,差一下calico的启动日志,注意开头的部分,是否网桥选错了
2019-09-21
共1条回复

Kubernetes生产落地全程实践

一个互联网公司落地Kubernetes全过程点点滴滴

2293 学习 · 2216 问题

查看课程