Openshift Route无法从Service Pod进行负载平衡 [英] Openshift Route is not load balancing from Service pods

查看:414
本文介绍了Openshift Route无法从Service Pod进行负载平衡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前在Openshift Origin 3.9和Online上尝试过. 我已经在Openshift上部署了一个简单的hello world php应用程序.它有一条服务和一条路线.

I have tried before on Openshift Origin 3.9 and Online. I have deployed a simple hello world php app on Openshift. It has a Service and a Route.

当我呼叫路线时,我将获得Hello World和Pod IP的预期输出.我们将此pod ip称为1.1.1.1

When I call the route, I am getting expected output with Hello world and the Pod IP. Let's call this pod ip as 1.1.1.1

现在,我在相同的服务下部署了具有较小文本更改和相同标签的相同应用程序.我们将此Pod IP称为2.2.2.2

Now i deployed same app with small text change with same label under same Service. Let's call this pod ip as 2.2.2.2

我可以看到两个Pod在单个Service中运行. 现在,当我呼叫路线时,它始终显示Podip 1.1.1.1 我的路线从未碰到第二个吊舱.

I can see both pods running in a single Service. Now when I call the route, it always shows Podip 1.1.1.1 My route never hits the second pod.

我的理解是Route会调用Service,而Service将在可用吊舱之间进行负载平衡.

My understand is Route will call the Service and Service will load balance between available pods.

但是这没有发生.任何帮助表示赞赏.

But it isn't happening. Any help is appreciated.

推荐答案

HAProxy路由器的默认行为是使用cookie来确保粘性"路由.这使会话可以保留在同一窗格中. https://docs.openshift.com/container-platform/3.11 /architecture/networking/routes.html

The default behavior of the HAProxy router is to use a cookie to ensure "sticky" routing. This enables sessions to remain with the same pod. https://docs.openshift.com/container-platform/3.11/architecture/networking/routes.html

如果在通往true的路线上设置haproxy.router.openshift.io/disable_cookies批注,则应禁用此行为.

If you set a haproxy.router.openshift.io/disable_cookies annotation on the route to true it should disable this behavior.

这篇关于Openshift Route无法从Service Pod进行负载平衡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆