K8s Ingress服务返回503,在Pod日志中什么也没有

时间:2018-07-01 13:53:17

标签: nginx kubernetes minikube kubernetes-ingress

我正在运行一个Ingress,它应该连接到Pod中的图像。当我做describe时,例如,

$ kubectl describe svc solar-demo
Name:              solar-demo
Namespace:         default
Labels:            <none>
Annotations:       kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"name":"solar-demo","namespace":"default"},"spec":{"ports":[{"name":"city","port":3000...
Selector:          app=solardemo
Type:              ClusterIP
IP:                10.97.245.248
Port:              city  3000/TCP
TargetPort:        3000/TCP
Endpoints:         172.17.0.4:3000,172.17.0.6:3000
Port:              solar  3001/TCP
TargetPort:        3001/TCP
Endpoints:         172.17.0.4:3001,172.17.0.6:3001
Session Affinity:  None
Events:            <none>

它甚至正确列出了我图像的IP地址。但是,当我尝试获得服务时,我只要求一个根目录就得到404,这很好,因为当我尝试到达路线时,我没有将映射/映射到任何东西,并且503时没有错误{1}}和/或/solar

当我检查日志时,它返回:

/city

和其他服务的相同之处:

$ kubectl logs solar-demo-5845984b94-xp82l solar-svc
npm info it worked if it ends with ok
npm info using npm@5.6.0
npm info using node@v9.11.2
npm info lifecycle nf-images-test@1.0.0~prestart-solar-svc: nf-images-test@1.0.0
npm info lifecycle nf-images-test@1.0.0~start-solar-svc: nf-images-test@1.0.0

> nf-images-test@1.0.0 start-solar-svc /opt/app-root/src
> node solar-svc.js

{"level":30,"time":1530271233676,"msg":"Server listening at http://0.0.0.0:3001","pid":26,"hostname":"solar-demo-5845984b94-xp82l","v":1}
server listening on 3001

我得到503s,图像从没收到任何请求,好像$ kubectl logs solar-demo-5845984b94-xp82l api npm info it worked if it ends with ok npm info using npm@5.6.0 npm info using node@v9.11.2 npm info lifecycle nf-images-test@1.0.0~prestart-api: nf-images-test@1.0.0 npm info lifecycle nf-images-test@1.0.0~start-api: nf-images-test@1.0.0 > nf-images-test@1.0.0 start-api /opt/app-root/src > node api.js {"level":30,"time":1530271244205,"msg":"Server listening at http://0.0.0.0:3000","pid":21,"hostname":"solar-demo-5845984b94-xp82l","v":1} server listening on 3000 “认为”每一个Ingress都掉下来了一样。我可以检查什么?

Pod

请告知。

1 个答案:

答案 0 :(得分:2)

在注释中,缺少配置:

nginx.org/server-snippet: "proxy_ssl_verify off;"