2

我的设置适用于我当地的 Minikube。但是在 GCE 上,Traefik 控制器在成功启动后大约半分钟(Started container with docker id xxx, traefik-ingress-controller-d8jb6 1/1 Running)终止。当豆荚运行时,我没有从kubectl describe pod --selector=k8s-app=traefik-ingress-lb --namespace=kube-system. 但是因为我不能像我一样遵循describe命令,所以我不知道在 pod 终止之前是否有任何新事件弹出来描述错误。-flogs

BTW:GCE 仍然使用 Kubernetes 1.5.7。

在 Minikube 和 GCE 中,Ingress 似乎找到了服务,因为我在容器中看到以下日志输出:

time="2017-06-01T11:57:56Z" level=debug msg="Configuration received from provider kubernetes: {"backends":{"www.sandroboehme.de/":{"servers":{"web-deployment-439093506-08dk8":{"url":"http://10.0.0.4:8080","weight":1}},"loadBalancer":{"method":"wrr"}}},"frontends":{"www.sandroboehme.de/":{"entryPoints":["http"],"backend":"www.sandroboehme.de/","routes":{"/":{"rule":"PathPrefix:/"},"www.sandroboehme.de":{"rule":"Host:www.sandroboehme.de"}},"passHostHeader":true,"priority":1,"basicAuth":[]}}}" 
time="2017-06-01T11:57:56Z" level=debug msg="Last kubernetes config received more than 2s, OK" 
time="2017-06-01T11:57:56Z" level=debug msg="Creating frontend www.sandroboehme.de/" 
time="2017-06-01T11:57:56Z" level=debug msg="Wiring frontend www.sandroboehme.de/ to entryPoint http" 
time="2017-06-01T11:57:56Z" level=debug msg="Creating route / PathPrefix:/" 
time="2017-06-01T11:57:56Z" level=debug msg="Creating route www.sandroboehme.de Host:www.sandroboehme.de" 
time="2017-06-01T11:57:56Z" level=debug msg="Creating backend www.sandroboehme.de/" 
time="2017-06-01T11:57:56Z" level=debug msg="Creating load-balancer wrr" 
time="2017-06-01T11:57:56Z" level=debug msg="Creating server web-deployment-439093506-08dk8 at http://10.0.0.4:8080 with weight 1" 
time="2017-06-01T11:57:56Z" level=info msg="Server configuration reloaded on :80"

但在 GCE 案例中,最后的日志消息如下:

time="2017-06-01T10:14:50Z" level=info msg="I have to go... terminated" 
time="2017-06-01T10:14:50Z" level=info msg="Stopping server" 
time="2017-06-01T10:14:50Z" level=debug msg="Waiting 10s seconds before killing connections on entrypoint http..." 
time="2017-06-01T10:14:50Z" level=debug msg="Entrypoint http closed" 
time="2017-06-01T10:14:50Z" level=info msg="Server stopped" 
time="2017-06-01T10:14:50Z" level=info msg="Shutting down" 
time="2017-06-01T10:14:50Z" level=error msg="Error creating server: http: Server closed"

如何调试它以找出导致 pod 终止的原因?

完整的 yaml 文件可以在 GitHub 帐户https://github.com/sandroboehme/sling-gce-k8s-launchpad/tree/traefik/src/main/k8s中找到,该single-mongo文件夹在这种情况下不相关。请确保仅在 GCE 案例中使用 googlecloud_hdd.yaml 并storage-class: "slow"在 Minikube 案例中删除唯一。非常感谢您的任何提示!

4

0 回答 0