Istio Pod到Pod的通信直接将数据包传递到应用程序;跳过代理

时间:2020-10-20 17:25:36

标签: kubernetes istio

我们观察到istio网格中的怪异行为。我们有一个具有多种服务的应用程序。今天,我们意识到对服务之一的请求失败了。查看日志,我们发现数据包被直接传递到“ app”容器,而不是“ istio-proxy”。

我不知道是否有人可以复制它,但是我所做的是创建一个单独的演示名称空间并部署了两个服务(nginx和带有curl的debian)。当我从debian中卷曲nginx时,我得到了:

upstream connect error or disconnect/reset before headers. reset reason: connection failure/

这些是istio-proxy容器的日志:

2020-10-20T16:32:32.914079Z     info    sds     node:sidecar~10.1.11.212~nginx.demo~demo.svc.cluster.local-1 resource:ROOTCA new connection
2020-10-20T16:32:32.914436Z     info    sds     node:sidecar~10.1.11.212~nginx.demo~demo.svc.cluster.local-2 resource:default new connection
2020-10-20T16:32:33.001150Z     info    cache   Root cert has changed, start rotating root cert for SDS clients
2020-10-20T16:32:33.001310Z     info    sds     node:sidecar~10.1.11.212~nginx.demo~demo.svc.cluster.local-2 resource:default pushed key/cert pair to proxy
2020-10-20T16:32:33.001322Z     info    sds     node:sidecar~10.1.11.212~nginx.demo~demo.svc.cluster.local-2 resource:default pushed secret
2020-10-20T16:32:33.114361Z     info    sds     node:sidecar~10.1.11.212~nginx.demo~demo.svc.cluster.local-1 resource:ROOTCA pushed root cert to proxy
2020-10-20T16:32:33.114388Z     info    sds     node:sidecar~10.1.11.212~nginx.demo~demo.svc.cluster.local-1 resource:ROOTCA pushed secret
2020-10-20T16:32:34.789815Z     info    Envoy proxy is ready

这些是Nginx容器的日志

10.1.11.100 - - [20/Oct/2020:16:34:18 +0000] "\x16\x03\x01\x00\xCE\x01\x00\x00\xCA\x03\x03\x13`\xD9\xF6\xBD%\xF0\x88\x8B\x08m\xD98ZG\x90\x13\x8CI\xBA\x02\x0E\x0F" 400 157 "-" "-" "-"
10.1.11.100 - - [20/Oct/2020:16:34:18 +0000] "\x16\x03\x01\x00\xCE\x01\x00\x00\xCA\x03\x03\x01Y\xB0\x5CT \xC8:d\xD0|G\xF2\x04\xCD\x15-\xBFE(\xF4b'\xA08\x8B\xD5\xF1\x8D\xDF-s\x00\x00\x1C\xC0+\xCC\xA9\xC0/\xCC\xA8\xC0\x09\xC0\x13\x00\x9C\x00/\xC0,\xC00\xC0" 400 157 "-" "-" "-"
10.1.11.100 - - [20/Oct/2020:16:34:18 +0000] "\x16\x03\x01\x00\xCE\x01\x00\x00\xCA\x03\x03N\xEB\xA7tq\xBC\xB9\x8AR\x98A0J\xF6\x88I#\xCF~\xE8\xD7\xD4pO\x09\x14\x90\xEE\x08\x94\x1D\x8C\x00\x00\x1C\xC0+\xCC\xA9\xC0/\xCC\xA8\xC0\x09\xC0\x13\x00\x9C\x00/\xC0,\xC00\xC0" 400 157 "-" "-" "-"
10.1.11.100 - - [20/Oct/2020:16:35:02 +0000] "\x16\x03\x01\x00\xCE\x01\x00\x00\xCA\x03\x03\x9A\xF1\xE4)\xEF\xCB\xBA\xD4\xA9\xC2\x14\x04e\x9A\x84\x11&q\x9E\xC0\xF1&l\xE8\xCF\xE3\x1C\x94k2\xCF\xE1\x00\x00\x1C\xC0+\xCC\xA9\xC0/\xCC\xA8\xC0\x09\xC0\x13\x00\x9C\x00/\xC0,\xC00\xC0" 400 157 "-" "-" "-"
10.1.11.100 - - [20/Oct/2020:16:35:02 +0000] "\x16\x03\x01\x00\xCE\x01\x00\x00\xCA\x03\x03<\xEB\xA6W\xCB\x08miMl\x1A~\xD5\xA6DTm\xD5\xE83\xED\xDE\x8C}\xDF*4H\x87\xDC?\xE8\x00\x00\x1C\xC0+\xCC\xA9\xC0/\xCC\xA8\xC0\x09\xC0\x13\x00\x9C\x00/\xC0,\xC00\xC0" 400 157 "-" "-" "-"
10.1.11.100 - - [20/Oct/2020:16:35:02 +0000] "\x16\x03\x01\x00\xCE\x01\x00\x00\xCA\x03\x03\xDC\xD7\xF2-\x05ZD\xA3^L\x01\x07j\x1AW5@\x08\xC5\xCA\xFF\x90\xBB\xC9R\xF7|\xD2\xFC9,\x98\x00\x00\x1C\xC0+\xCC\xA9\xC0/\xCC\xA8\xC0\x09\xC0\x13\x00\x9C\x00/\xC0,\xC00\xC0" 400 157 "-" "-" "-"

如果检查日志的时间戳,您将看到所有请求都直接发送到了nginx容器。另外,我们知道,当您将加密的数据包发送到需要纯文本的端点时,此输出是nginx服务器的典型输出。因此,我们认为数据包在一端被加密,然后直接传递给nginx。无需通过代理进行解密。

现在,所有新创建的服务都会因此问题而失败,并且其余服务可以正常运行。我们现在删除了网格,以了解发生了什么。

我们正在使用启用了mTLS的Istio 1.5.2。

0 个答案:

没有答案
相关问题