使用
- minikube 0.23
- kubectl 1.8x
- istio 0.2.10
启用自动边车注入并使用所有正确的插件启动 minikube
minikube start --vm-driver=xhyve --extra-config=apiserver.Admission.PluginNames="Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,GenericAdmissionWebhook,ResourceQuota" --kubernetes-version=v1.7.5
我看到微服务旁边的边车。
NAME READY STATUS RESTARTS AGE
microse-598544478f-hs8pv 2/2 Running 2 1d
但我现在无法在启用 istio 的情况下访问患者微服务。
export GATEWAY_URL=$(kubectl get po -n istio-system -l istio=ingress -o 'jsonpath={.items[0].status.hostIP}'):$(kubectl get svc istio-ingress -n istio-system -o 'jsonpath={.spec.ports[0].nodePort}')
curl -iv -H "Content-Type: application/json" -X PUT $GATEWAY_URL -d '{"firstField":"firstData"}'
我得到以下信息:
* Rebuilt URL to: 192.168.64.4:31496/
* Trying 192.168.64.4...
* TCP_NODELAY set
* Connected to 192.168.64.4 (192.168.64.4) port 31496 (#0)
> PUT / HTTP/1.1
> Host: 192.168.64.4:31496
> User-Agent: curl/7.54.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 84
>
* upload completely sent off: 84 out of 84 bytes
< HTTP/1.1 404 Not Found
HTTP/1.1 404 Not Found
< date: Fri, 03 Nov 2017 13:53:31 GMT
date: Fri, 03 Nov 2017 13:53:31 GMT
< server: envoy
server: envoy
< connection: close
connection: close
< content-length: 0
content-length: 0
<
* Closing connection 0
没有 istio 做这个 PUT 没有问题。谢谢你的帮助。