AD
curl -I http://10.152.183.73
curl: (7) Failed to connect to 10.152.183.73 port 80: Connection refused
из контейнера
$ kubectl exec -it pod/mw-5594f5d88c-2gjt7 -- bash
root@mw-5594f5d88c-2gjt7:/var/www# curl -I http://localhost
HTTP/1.1 302 Found
Size: a a a
AD
L
AL
AL
L
4
SW
DS
L
A
AD
A
GG
VB
L
VZ
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: proxy
spec:
hosts:
- proxy.external.ru
ports:
- number: 3128
name: tcp
protocol: TCP
resolution: DNS
location: MESH_EXTERNAL
---
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: wikipedia-org
spec:
hosts:
- wikipedia.org
ports:
- number: 80
name: http
protocol: HTTP
resolution: DNS
location: MESH_EXTERNAL
---
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: wikipedia-org-https
spec:
hosts:
- wikipedia.org
ports:
- number: 443
name: https
protocol: HTTPS
resolution: DNS
location: MESH_EXTERNAL
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: wikipedia-org
namespace: test
spec:
hosts:
- wikipedia.org
gateways:
- mesh
http:
- match:
- gateways:
- mesh
port: 80
route:
- destination:
host: proxy.external.ru
port:
number: 3128
tls:
- match:
- gateways:
- mesh
port: 443
sniHosts:
- wikipedia.org
route:
- destination:
host: proxy.external.ru
port:
number: 3128
L
L
VZ
# env | grep proxyВот с хост машины курл
http_proxy=http://proxy.external.ru:3128
https_proxy=http://proxy.external.ru:3128
# curl -v https://wikipedia.org
...
* Connected to proxy.external.ru (192.168.1.11) port 3128 (#0)
* Establish HTTP proxy tunnel to wikipedia.org:443
> CONNECT wikipedia.org:443 HTTP/1.1
> Host: wikipedia.org:443
...
< HTTP/1.1 200 OK
...