Environment  环境

Rancher Istio chart upgraded to 107.2.0+up1.26.2 from any lower version. 
Rancher Istio 图表从任何较低版本升级为 107.2.0+up1.26.2。 

Situation  地理位置
  • After upgrading from rancher-istio v1.24 to v1.26 via Rancher UI, DNS capture and auto-allocation stopped working as expected.
    从 rancher-istio v1.24 升级到 v1.26 后,DNS 捕获和自动分配不再如预期般工作。
<span style="color:#000000"><span style="background-color:#ffffff"><span style="background-color:#efefef"><code> meshConfig:
    defaultConfig:
      proxyMetadata:
        ISTIO_META_DNS_CAPTURE: "true"
        ISTIO_META_DNS_AUTO_ALLOCATE: "true"</code></span></span></span>
  • When accessing services, DNS resolves incorrectly, sometimes pointing to another service’s IP or port. This happens particularly when multiple ServiceEntries use the same domain but different ports.
    访问服务时,DNS 解析错误,有时指向其他服务的 IP 或端口。当多个 ServiceEntry 使用同一域但端口不同时,尤其会出现这种情况。
  • Prior to the upgrade, this setup worked without issues.
    升级前,这个设置运行良好。
Resolution  结局

This can be handled by any of the approaches mentioned below:
这可以通过以下任何方法来处理:

1] Maintain a single ServiceEntry that uses the same domain with different ports:
1] 维护一个使用相同域但端口不同的单一 ServiceEntry:

<span style="color:#000000"><span style="background-color:#ffffff"><span style="background-color:#efefef"><code>apiVersion: <a data-cke-saved-href="http://networking.istio.io/v1" href="http://networking.istio.io/v1">networking.istio.io/v1</a>
kind: ServiceEntry
metadata:
  name: local
spec:
  hosts: ["sshhttps.test"]
  location: MESH_EXTERNAL
  resolution: DNS
  ports:
  - number: 443
    name: tls-https
    protocol: TLS
  - number: 22
    name: tcp-ssh
    protocol: TCP</code></span></span></span>

2] Manually hardcode the same IP address for each ServiceEntry that shares the same domain name.
2] 手动为每个共享同一域名的 ServiceEntry 硬编码相同的 IP 地址。

apiVersion: networking.istio.io/v1
kind: ServiceEntry
metadata:
  name: local-https
spec:
  hosts: ["dummy.local"]
  addresses:
    - 240.240.0.5
  location: MESH_EXTERNAL
  resolution: DNS
  ports:
  - number: 443
    name: tls-port
    protocol: TLS
---
apiVersion: networking.istio.io/v1
kind: ServiceEntry
metadata:
  name: local-ssh
spec:
  hosts: ["dummy.local"]
  addresses:
    - 240.240.0.5
  location: MESH_EXTERNAL
  resolution: DNS
  ports:
  - number: 22
    name: tcp-port
    protocol: TCP
Cause  病因

In rancher-istio v1.26, an upstream change causes each ServiceEntry with the same domain to receive its own VIP, resulting in DNS resolution conflicts.
在 rancher-istio v1.26 中,上游的变更会导致同一域的每个 ServiceEntry 收到自己的 VIP,导致 DNS 解析冲突。

<span style="color:#000000"><span style="background-color:#ffffff"><span style="background-color:#efefef"><code># kubectl get se local-ssh   -o yaml | yq '.status.addresses'
- host: sshhttps.test
  value: 240.240.0.5
# kubectl get se local-https   -o yaml | yq '.status.addresses'
- host: sshhttps.test
  value: 240.240.0.4</code></span></span></span>

访问Rancher-K8S解决方案博主,企业合作伙伴 :
https://blog.csdn.net/lidw2009

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐