Kubernetes 如何在没有服务发现的情况下为mesh federation配置istio?

Kubernetes 如何在没有服务发现的情况下为mesh federation配置istio?,kubernetes,istio,istio-gateway,Kubernetes,Istio,Istio Gateway,多信任部署模型 我想将多个网格连接在一起。我目前管理3个不同的AKS集群 行动(aks-ops-euwest-1) 分段(aks-stg-euwest-1) 生产(aks-prod-euwest-1) 我有Hashicorp Vault运行在操作上,我希望能够使用istio mTLS(用于自动秘密轮换)访问正在暂存和生产中运行的Postgres 每个集群都在不同的网络中运行istio(多主)。每个集群都有不同的ClusterName、MeshID、TrustDomain和NetworkID

多信任部署模型

我想将多个网格连接在一起。我目前管理3个不同的AKS集群

  • 行动(aks-ops-euwest-1)
  • 分段(aks-stg-euwest-1)
  • 生产(aks-prod-euwest-1)
我有Hashicorp Vault运行在操作上,我希望能够使用istio mTLS(用于自动秘密轮换)访问正在暂存和生产中运行的Postgres

每个集群都在不同的网络中运行istio(多主)。每个集群都有不同的ClusterName、MeshID、TrustDomain和NetworkID。不过,
cacerts
机密配置有公共根CA

从,要启用跨群集通信,必须部署一个特殊的
eastwestgateway
。tlsMode是
自动通过的

这些是东西网关的环境变量

# sni-dnat adds the clusters required for AUTO_PASSTHROUGH mode
- name: ISTIO_META_ROUTER_MODE
  value: "sni-dnat"
# traffic through this gateway should be routed inside the network
- name: ISTIO_META_REQUESTED_NETWORK_VIEW
  value: aks-ops-euwest-1
我不想通过在群集之间共享机密来启用自动服务发现。为什么?因为我想要一个细粒度的控制,控制网格之间要公开哪些服务。我希望能够指定指向来自远程集群的serviceaccounts的
授权策略
(因为信任域不同)

例如:

这是从

在某些高级场景中,可能不需要跨集群进行负载平衡 渴望的例如,在蓝色/绿色部署中,您可以部署 系统的不同版本适用于不同的群集。在这种情况下,, 每个集群作为一个独立的网格有效地运行。这 行为可以通过两种方式实现:

  • 不要在群集之间交换远程机密。这在集群之间提供了最强的隔离。
  • 使用VirtualService和DestinationRule禁止在两个版本的服务之间进行路由
istio文档没有指定的是如何在不共享机密的情况下启用跨集群通信。当分享秘密时,istiod将创建额外的特使配置,允许POD通过东西网关进行透明通信。它没有指定的是如何在不共享机密时手动创建这些配置

tlsMode是
自动通过的
。查看istio存储库

    // Similar to the passthrough mode, except servers with this TLS
    // mode do not require an associated VirtualService to map from
    // the SNI value to service in the registry. The destination
    // details such as the service/subset/port are encoded in the
    // SNI value. The proxy will forward to the upstream (Envoy)
    // cluster (a group of endpoints) specified by the SNI
    // value. This server is typically used to provide connectivity
    // between services in disparate L3 networks that otherwise do
    // not have direct connectivity between their respective
    // endpoints. Use of this mode assumes that both the source and
    // the destination are using Istio mTLS to secure traffic.
    // In order for this mode to be enabled, the gateway deployment
    // must be configured with the `ISTIO_META_ROUTER_MODE=sni-dnat`
    // environment variable.
有趣的部分是
服务/子集/端口等目标详细信息在SNI值中编码

似乎在集群之间共享机密时,istio将添加特使配置,有效地将这些服务/子集/端口编码到特使集群的SNI值中。然而,当秘密不被分享时,我们怎么能得到同样的结果呢

我已经看过了,但是它已经过时了,并且没有使用
eastwestgateway

我也在istio论坛和上发布了问题,但很难从那里获得帮助

    // Similar to the passthrough mode, except servers with this TLS
    // mode do not require an associated VirtualService to map from
    // the SNI value to service in the registry. The destination
    // details such as the service/subset/port are encoded in the
    // SNI value. The proxy will forward to the upstream (Envoy)
    // cluster (a group of endpoints) specified by the SNI
    // value. This server is typically used to provide connectivity
    // between services in disparate L3 networks that otherwise do
    // not have direct connectivity between their respective
    // endpoints. Use of this mode assumes that both the source and
    // the destination are using Istio mTLS to secure traffic.
    // In order for this mode to be enabled, the gateway deployment
    // must be configured with the `ISTIO_META_ROUTER_MODE=sni-dnat`
    // environment variable.