Skip to content

Instantly share code, notes, and snippets.

@yangl
Last active December 27, 2018 11:13
Show Gist options
  • Save yangl/6cf19774c00711a628f9857d8fb5d1ba to your computer and use it in GitHub Desktop.
Save yangl/6cf19774c00711a628f9857d8fb5d1ba to your computer and use it in GitHub Desktop.
Istio访问集群多个外部服务,可以使用istio sleep那个pod进去发送curl验证 https://preliminary.istio.io/zh/docs/tasks/traffic-management/egress/
kubectl exec -it sleep-68648fd5b5-p6hsc -c sleep -- sh
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: http-cnn
spec:
hosts:
- ifeve.com
- xxfox.perfma.com
ports:
- number: 80
name: http
protocol: HTTP
resolution: DNS
location: MESH_EXTERNAL
---
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: https-cn
spec:
hosts:
- github.com
- edition.cnn.com
ports:
- number: 443
name: https
protocol: HTTPS
resolution: DNS
location: MESH_EXTERNAL
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: https-cn
spec:
hosts:
- github.com
- edition.cnn.com
tls:
- match:
- port: 443
sni_hosts:
- github.com
route:
- destination:
host: github.com
port:
number: 443
weight: 100
- match:
- port: 443
sni_hosts:
- edition.cnn.com
route:
- destination:
host: edition.cnn.com
port:
number: 443
weight: 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment