十一 Istio:向istio服务网格中引入虚拟机( 五 )

请注意,WorkloadEntry 和 ServiceEntry 在未来最终将自动创建 。
$VM_NAMESPACE 中创建服务条目资源 。
kubectl apply -n ${VM_NAMESPACE} -f serviceentry.yaml我们现在可以使用 Kubernetes 服务名称 hello-vm.vm-namespace 来访问虚拟机上的工作负载 。让我们在集群内运行一个 Pod,并尝试从那里访问该服务:
$ kubectl run curl --image=radial/busyboxplus:curl -i --tty If you don't see a command prompt, try pressing enter. [ root@curl:/ ]$在你得到 Pod 中的命令提示后,你可以运行 curl 并访问工作负载 。你应该看到一个目录列表的响应 。同样地,你会注意到在 HTTP 服务器运行的实例上有一个日志条目:
[ root@curl:/ ]$ curl hello-vm.vm-namespace <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dt d"> <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> ...

经验总结扩展阅读