您好,登錄后才能下訂單哦!
小編給大家分享一下kubernetes中istio-1.0.0如何部署和試用,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!
一:簡介
本文介紹如何在kubernetes1.10.4集群中部署istio-1.0.0 并試用istio自帶的bookinfo實(shí)例應(yīng)用。
二:安裝
1.獲取安裝包
wget https://github.com/istio/istio/releases/download/1.0.0/istio-1.0.0-linux.tar.gz
tar -zxvf istio-1.0.0-linux.tar.gz
2.安裝istioctl
如果手動(dòng)注入sidecar的話需要使用這個(gè)命令:
cp istio-1.0./bin/istioctl /usr/local/bin/
設(shè)置環(huán)境變量:
ISTIO_HOME=/root/istio-1.0
PATH=$ISTIO_HOME/bin:$PATH
export ISTIO_HOME PATH
3.安裝istio核心組件
kubectl apply -f istio-1.0.0/install/kubernetes/istio-demo.yaml
gcr.io和quay.io相關(guān)的鏡像下載不了的話可以替換為自己的鏡像:
daocloud.io/liukuan73/proxy_init:1.0.0
daocloud.io/liukuan73/galley:1.0.0
daocloud.io/liukuan73/mixer:1.0.0
daocloud.io/liukuan73/proxyv2:1.0.0
daocloud.io/liukuan73/pilot:1.0.0
daocloud.io/liukuan73/citadel:1.0.0
daocloud.io/liukuan73/servicegraph:1.0.0
daocloud.io/liukuan73/sidecar_injector:1.0.0
daocloud.io/liukuan73/istio-grafana:1.0.0
4.安裝結(jié)果驗(yàn)證
三:試用
1.sidecar自動(dòng)注入配置
Istio裝好后,如果想sidecar在應(yīng)用啟動(dòng)時(shí)自動(dòng)注入到pod中,還需要配置如下4步:
a.安裝istio-sidecar-injector
安裝了istio-sidecar-injector后,kubectl create起應(yīng)用的時(shí)候sidecar容器會(huì)直接自動(dòng)注入到pod中,而不用手動(dòng)注入。
b.啟用mutating webhook admission controller
在kube-apiserver的啟動(dòng)參數(shù)的admission controller中按正確順序加入如下兩個(gè)controller:MutatingAdmissionWebhook,ValidatingAdmissionWebhook
--admission-control=ServiceAccount,Initializers,NamespaceLifecycle,NamespaceExists,LimitRanger,DefaultStorageClass,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota
c.啟用admissionregistration api
kubectl api-versions | grep admissionregistration
admissionregistration.k8s.io/v1beta1
d.為需要自動(dòng)注入sidecar的namespace打label
kubectl label namespace istio-test istio-injection=enabled
kubectl get namespace -L istio-injection
2.啟動(dòng)示例應(yīng)用
a.示例結(jié)構(gòu)
b.安裝示例
kubectl apply -n istio-test -f istio-1.0.0/samples/bookinfo/platform/kube/bookinfo.yaml
c. 配置traefik Ingress
為了便于集群外訪問驗(yàn)證,配置Ingress代理
apiVersion: extensions/v1beta1 kind: Ingress metadata: name: traefik-ingress namespace: kube-system spec: rules: - host: elasticsearch.donkey http: paths: - path: / backend: serviceName: elasticsearch-logging servicePort: 9200 - host: kibana.donkey http: paths: - path: / backend: serviceName: kibana-logging servicePort: 5601 - host: locust.donkey http: paths: - path: / backend: serviceName: locust-master servicePort: 8089 - host: dashboard.donkey http: paths: - path: / backend: serviceName: kubernetes-dashboard servicePort: 32666 --- apiVersion: extensions/v1beta1 kind: Ingress metadata: name: istio-ingress namespace: istio-system spec: rules: - host: grafana.istio.donkey http: paths: apiVersion: extensions/v1beta1 kind: Ingress metadata: name: traefik-ingress namespace: kube-system spec: rules: - host: elasticsearch.donkey http: paths: - path: / backend: serviceName: elasticsearch-logging servicePort: 9200 - host: kibana.donkey http: paths: - path: / backend: serviceName: kibana-logging servicePort: 5601 - host: locust.donkey http: paths: - path: / backend: serviceName: locust-master servicePort: 8089 - host: dashboard.donkey http: paths: - path: / backend: serviceName: kubernetes-dashboard servicePort: 32666 --- apiVersion: extensions/v1beta1 kind: Ingress metadata: name: istio-ingress namespace: istio-system spec: rules: - host: grafana.istio.donkey http: paths: - path: / backend: serviceName: grafana servicePort: 3000 - host: zipkin.istio.donkey http:
3.示例驗(yàn)證
a.bookinfo 示例 http://productpage.donkey/productpage?u=normal
b.監(jiān)控 http://grafana.istio.donkey
c.Prometheus頁面 http://prometheus.istio.donkey
d.ServiceGraph頁面
看完了這篇文章,相信你對(duì)“kubernetes中istio-1.0.0如何部署和試用”有了一定的了解,如果想了解更多相關(guān)知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。