我正在尝试从 EKS fargate pod 连接到在“假节点”上运行的 kubelet。
例如,我有两个带有 IP 的 nginx pod,10.0.0.1
并10.0.0.2
托管在两个具有相同 IP10.0.0.1
和10.0.0.2
.
从 pod10.0.0.1
我可以正确运行10.0.0.2
:
curl -X GET https://10.0.0.2:10250/stats/summary --header "Authorization: Bearer $TOKEN" --insecure
{
"node": {
"nodeName": "fargate-ip-10.0.0.2.us-east-2.compute.internal",
"systemContainers": [
{
"name": "pods",
"startTime": "2021-03-02T11:21:55Z",
[...]
但是,如果我尝试卷曲同一台主机
10.0.0.1:10250
,我会收到拒绝连接。从第二个 pod 执行相同操作会导致相反的结果,我可以查询
10.0.0.1
而不是10.0.0.2
.请注意,如果我 curl 端口 80 nginx 正确回答,因此似乎从 pod 本身连接时,网络无法理解主机可以回答请求
此外,我知道我可以通过代理(
curl -X GET https://172.20.0.1:443/api/v1/nodes/fargate-ip-10-0-0-1.us-east-2.compute.internal/stats/summary --header "Authorization: Bearer $TOKEN" --insecure
),但由于一些限制,这在我的场景中是不可行的