您的位置:首页 > 其它

istio入门(04)istio的helloworld-部署构建

2017-11-06 17:07 267 查看
参考链接:
https://zhuanlan.zhihu.com/p/27512075
安装
Istio目前仅支持Kubernetes,在部署Istio之前需要先部署好Kubernetes集群并配置好kubectl客户端。

下载Istio
curl -L https://git.io/getIstio | sh -
cd istio-0.1.6/
cp bin/istioctl /usr/local/bin/

创建RBAC角色和绑定
$ kubectl apply -f install/kubernetes/istio-rbac-beta.yaml
clusterrole "istio-pilot" created
clusterrole "istio-ca" created
clusterrole "istio-sidecar" created
rolebinding "istio-pilot-admin-role-binding" created
rolebinding "istio-ca-role-binding" created
rolebinding "istio-ingress-admin-role-binding" created
rolebinding "istio-sidecar-role-binding" created

如果碰到下面的错误
Error from server (Forbidden): error when creating "install/kubernetes/istio-rbac-beta.yaml": clusterroles.rbac.authorization.k8s.io "istio-pilot" is forbidden: attempt to grant extra privileges: [{[*] [istio.io] [istioconfigs] [] []} {[*] [istio.io] [istioconfigs.istio.io] [] []} {[*] [extensions] [thirdpartyresources] [] []} {[*] [extensions] [thirdpartyresources.extensions] [] []} {[*] [extensions] [ingresses] [] []} {[*] [] [configmaps] [] []} {[*] [] [endpoints] [] []} {[*] [] [pods] [] []} {[*] [] [services] [] []}] user=&{user@example.org [...]

需要给用户授予admin权限
kubectl create clusterrolebinding myname-cluster-admin-binding --clusterrole=cluster-admin --user=myname@example.org

部署Istio核心服务
两种方式(选择其一执行)
禁止Auth:kubectl apply -f install/kubernetes/istio.yaml
启用Auth:kubectl apply -f install/kubernetes/istio-auth.yaml
部署Prometheus、Grafana和Zipkin插件

kubectl apply -f install/kubernetes/addons/prometheus.yaml
kubectl apply -f install/kubernetes/addons/grafana.yaml
kubectl apply -f install/kubernetes/addons/servicegraph.yaml
kubectl apply -f install/kubernetes/addons/zipkin.yaml

等一会所有Pod启动后,可以通过NodePort或负载均衡服务的外网IP来访问这些服务。比如通过NodePort方式,先查询服务的NodePort
$ kubectl get svc grafana -o jsonpath='{.spec.ports[0].nodePort}'
32070
$ kubectl get svc servicegraph -o jsonpath='{.spec.ports[0].nodePort}'
31072
$ kubectl get svc zipkin -o jsonpath='{.spec.ports[0].nodePort}'
30032
$ kubectl get svc prometheus -o jsonpath='{.spec.ports[0].nodePort}'
30890
通过http://<kubernetes-ip>:32070/dashboard/db/istio-dashboard访问Grafana服务
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: