我已经关注了使用外部 HTTPS 代理的整个主题,指出它是基于 VIP 的示例,而不是 k8s 服务方法。但在我的情况下,Squid 可以通过 k8s 服务访问,我想使用 FQDN 而不是 VIP 地址。
我已经更改了配置删除addresses
部分:
Squid Istio 服务入口:
apiVersion: networking.istio.io/v1beta1
kind: ServiceEntry
metadata:
name: proxy
spec:
hosts:
- squid.external.svc.cluster.local
location: MESH_EXTERNAL
exportTo:
- "."
ports:
- number: 3128
name: tcp
protocol: TCP
external
ns中的网格外部 Squid 部件:
鱿鱼荚:
ports:
- containerPort: 3128
name: http
protocol: TCP
鱿鱼k8s服务:
ports:
- name: http
port: 3128
protocol: TCP
targetPort: http
来自硬币的冰壶sleep
:
HTTPS_PROXY=http://squid.external:3128 curl https://en.wikipedia.org/wiki/Main_Page
在 sleep sidecar 上给出结果:
[2021-07-21T06:46:23.938Z] "CONNECT - HTTP/1.1" 404 NR route_not_found - "-" 0 0 0 - "-" "curl/7.77.0-DEV" "424a0870-af92-4a59-a3af-c8dc91b31512" "en.wikipedia.org:443" "-" - - 192.168.101.185:3128 10.10.2.8:39744 - -
其中 192.168.101.185 是 squid 服务 IP。
Envoy 报错说没有路由,但是找到了服务。缺少什么,出了什么问题?我感谢任何帮助或建议。