NodePort当我使用 Nginx 服务器访问 Istio 网关时curl,我得到了正确的响应,如下所示:
curl -v "http://52.66.195.124:30408/status/200"
* Trying 52.66.195.124:30408...
* Connected to 52.66.195.124 (52.66.195.124) port 30408 (#0)
> GET /status/200 HTTP/1.1
> Host: 52.66.195.124:30408
> User-Agent: curl/7.76.1
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< server: istio-envoy
< date: Sat, 18 Sep 2021 04:33:35 GMT
< content-type: text/html; charset=utf-8
< access-control-allow-origin: *
< access-control-allow-credentials: true
< content-length: 0
< x-envoy-upstream-service-time: 2
<
* Connection #0 to host …Run Code Online (Sandbox Code Playgroud) 来自istio 文档的多信任部署模型
\n\n我想将多个网格连接在一起。我目前管理 3 个不同的 AKS 集群
\n我在操作上运行 Hashicorp Vault,我\xe2\x80\x99d 希望能够到达例如。Postgres that\xe2\x80\x99s 使用 istio mTLS 在暂存和生产中运行(用于自动秘密轮换)。
\n每个集群都在不同的网络中运行 istio(多主)。每个集群都有不同的 ClusterName、MeshID、TrustDomain 和 NetworkID。不过,cacerts秘密是使用通用根 CA配置的
从istio 文档来看,为了实现跨集群通信,eastwestgateway必须部署一个特殊的。tlsMode 是AUTO_PASSTHROUGH。
这些是 eastwestgateway 的环境变量
\n# sni-dnat adds the clusters required for AUTO_PASSTHROUGH mode\n- name: ISTIO_META_ROUTER_MODE\n value: "sni-dnat"\n# traffic through this gateway should be routed inside the network\n- …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 istio 在 Kubernetes 集群中设置代理服务。我创建了两个不同的域。如果域是 foo.com,则应将其重定向到外部 URL,否则应将其路由到应用程序服务器。我已经使用虚拟服务和服务条目对此进行了配置。但是当我点击 foo.com 时,它会跳过授权标头。我需要一个授权标头来处理请求。有什么办法可以解决这个问题吗?提前致谢。
虚拟服务.yaml
apiVersion: networking.istio.io/v1beta1
kind: ServiceEntry
metadata:
name: external-svc-https
spec:
hosts:
- foo.com
location: MESH_EXTERNAL
ports:
- number: 443
name: https
protocol: TLS
resolution: DNS
---
kind: VirtualService
apiVersion: networking.istio.io/v1alpha3
metadata:
name: redirect
namespace: default
labels:
app: foo
env: staging
spec:
hosts:
- foo.com
gateways:
- istio-system/gateway
http:
- match:
- uri:
prefix: /
redirect:
authority: bar.com
Run Code Online (Sandbox Code Playgroud) 我有三个服务需要通过 istio 入口网关公开,我已经设置了这些服务 dns 记录以指向入口网关负载均衡器,但我还没有成功使其工作。
网关和虚拟服务配置文件:
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: test-gateway
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*.mywebsite.io"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: virtualservice
spec:
hosts:
- "*.mywebsite.io"
gateways:
- test-gateway
http:
- name: "api-gateway"
match:
- uri:
exact: "gateway.mywebsite.io"
route:
- destination:
host: gateway.default.svc.cluster.local
port:
number: 8080
- name: "visitor-service"
match:
- uri:
exact: "visitor-service.mywebsite.io"
route:
- destination:
host: visitor-service.default.svc.cluster.local
port: …Run Code Online (Sandbox Code Playgroud) 我正在尝试了解 Istio 流量路由。我以演示模式安装了 Istio,并开始使用示例。这些示例让您安装了一些网关(我安装了bookinfo-gateway并且httpbin-gateway.
但似乎我的所有流量都通过命名空间中定义的“http2”istio-ingressgateway端口istio-system。
该文档引用了这一点:
Istio 提供了一些您可以使用的预配置网关代理部署(istio-ingressgateway 和 istio-egressgateway) - 如果您使用我们的演示安装,则两者都会部署
但是当我运行时:kubectl -n istio-system get service istio-ingressgateway -o yaml结果显示kind: Service。
演示让我展示了其他网关kind: Gateway。
所以我很困惑...
istio-ingressgateway(这实际上是一项服务)。VirtualService到istio-ingressgateway. 难道只是寻找全部吗VirtualServices?我正在尝试将具有指定 URI 前缀的 HTTP 请求代理到外部 HTTPS 服务器。这个想法是使用 NPM 的内部 Nexus 存储库管理器,但不要像GitHub 项目那样放弃“npm 审计”的能力。应该使用 Istio 来完成,而不是部署额外的应用程序。
我配置了一个虚拟服务和一个服务条目以将流量路由到外部服务。到目前为止,还无法将 HTTP 请求转换为 HTTPS 请求。有机会这样做吗?
配置:
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: vs-nexus
spec:
hosts:
- "test.com"
gateways:
- gateway-xy
http:
- match:
- uri:
prefix: /-/npm/v1/security/audits/
route:
- destination:
port:
number: 443
host: registry.npmjs.org
- route:
- destination:
port:
number: 80
host: nexus
---
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: npmjs-ext
spec:
hosts:
- registry.npmjs.org
ports:
- number: 443
name: tls
protocol: …Run Code Online (Sandbox Code Playgroud)