我正在使用 minikube 运行服务网格,并尝试使用 fortio 访问在 minikube 之外运行的 api:
kubectl exec "$FORTIO_POD" -c fortio -- /usr/bin/fortio load -c 1 -qps 0 -n 1 -loglevel debug http://localhost:3000
但这给了我错误:
dial tcp 127.0.0.1:3000: connect: connection refused
下面是我创建的服务入口和destinationRule 对象:
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: localhost
spec:
hosts:
- localhost
location: MESH_EXTERNAL
ports:
- number: 3000
name: http
protocol: HTTP
resolution: STATIC
endpoints:
- address: 127.0.0.1
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: localhost
spec:
host: localhost
trafficPolicy:
tls:
mode: DISABLE
sni: localhost.local