[root@worker ~]# tail -f /var/log/istio/istio.log
2020-11-21T04:27:44.248846Z info sds resource:default pushed key/cert pair to proxy
2020-11-21T04:33:30.756067Z info xdsproxy disconnected from XDS server: istiod.istio-system.svc:15012
2020-11-21T04:33:31.285240Z info xdsproxy Envoy ADS stream established
2020-11-21T04:33:31.285453Z info xdsproxy connecting to upstream XDS server: istiod.istio-system.svc:15012
2020-11-21T04:38:48.670065Z info xdsproxy disconnected from XDS server: istiod.istio-system.svc:15012
2020-11-21T04:38:49.105717Z info xdsproxy Envoy ADS stream established
2020-11-21T04:38:49.105884Z info xdsproxy connecting to upstream XDS server: istiod.istio-system.svc:15012
2020-11-21T04:54:00.782318Z info xdsproxy disconnected from XDS server: istiod.istio-system.svc:15012
2020-11-21T04:54:01.037151Z info xdsproxy Envoy ADS stream established
2020-11-21T04:54:01.037506Z info xdsproxy connecting to upstream XDS server: istiod.istio-system.svc:15012
apiVersion: networking.istio.io/v1beta1
kind: WorkloadEntry
metadata:
name: test-vm-2
namespace: test
spec:
serviceAccount: test
address: 192.168.8.170
labels:
app: test
instance-id: vm2
---
apiVersion: v1
kind: Service
metadata:
name: test
namespace: test
labels:
app: test
spec:
ports:
- port: 80
name: http-vm
targetPort: 80
selector:
app: test
在vm上启动一个http server
python3 -m http.server 80
测试
kubectl exec -it helloworld-v1-776f57d5f6-nhmbc -n sample -- curl test.test.svc.cluster.local
Defaulting container name to helloworld.
Use 'kubectl describe pod/helloworld-v1-776f57d5f6-nhmbc -n sample' to see all of the containers in this pod.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Directory listing for /</title>
</head>
<body>
<h1>Directory listing for /</h1>
<hr>
<ul>
<li><a href="cluster.env">cluster.env</a></li>
...
</ul>
<hr>
</body>
</html>