




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、rootmaster # wget /competition/ServiceMesh.tar.gzrootmaster # tar -xf ServiceMesh.tar.gzrootmaster # docker load -i ServiceMesh/images/image.tarrootmaster # init-clusterrootmaster # kubectl cluster-infoKubernetes control plane is running at https:/apiserver.cluster.local:6443CoreDNS is running at ht
2、tps:/apiserver.cluster.local:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxyTo further debug and diagnose cluster problems, use kubectl cluster-info dump.rootmaster # cd ServiceMesh/rootmaster ServiceMesh# kubectl apply -f bookinfo/bookinfo.yamlservice/details createdserviceaccount/bo
3、okinfo-details createddeployment.apps/details-v1 createdservice/ratings createdserviceaccount/bookinfo-ratings createddeployment.apps/ratings-v1 createdservice/reviews createdserviceaccount/bookinfo-reviews createddeployment.apps/reviews-v1 createdservice/productpage createdserviceaccount/bookinfo-p
4、roductpage createddeployment.apps/productv1 createdrootmaster ServiceMesh# kubectl get podsNAME READY STATUS RESTARTS AGEdetails-v1-79f774bdb9-m98sl 1/1 Running 0 46sproductv1-6b746f74dc-snpf9 1/1 Running 0 46sratings-v1-b6994bb9-nmws8 1/1 Running 0 46sreviews-v1-545db77b95-4rtn4 1/1 Running 0 46sro
5、otmaster ServiceMesh# cat bookinfo-gateway.yamlapiVersion: networking.istio.io/v1alpha3kind: Gatewaymetadata: name: bookinfo-gatewayspec: selector: istio: ingressgateway # use istio default controller servers: - port: number: 80 name: http protocol: HTTP hosts: - *(“”請(qǐng)學(xué)生自行手打,不要復(fù)制)apiVersion: network
6、ing.istio.io/v1alpha3kind: VirtualServicemetadata: name: bookinfospec: hosts: - * gateways: - bookinfo-gateway http: - match: - uri: exact: /product uri: prefix: /static - uri: exact: /login - uri: exact: /logout - uri: prefix: /api/v1/products route: - destination: host: productpage port: number: 9
7、080rootmaster ServiceMesh# kubectl apply -f working.istio.io/bookinfo-gateway working.istio.io/bookinfo createdrootmaster ServiceMesh# kubectl get gatewayNAME AGEbookinfo-gateway 32srootmaster ServiceMesh# kubectl get svc -n istio-systemNAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGEistio-egressgateway
8、 ClusterIP 07 80/TCP,443/TCP 30mistio-ingressgateway LoadBalancer 02 15021:32634/TCP,80:22092/TCP,443:30119/TCP,31400:30282/TCP,15443:32486/TCP 30mrootmaster ServiceMesh# vi curl.sh#!/bin/bashwhile truedo curl :22092/productpage /dev/null 2&1 sleep 1donerootmaster ServiceMesh# chmod +x curl.shrootma
9、ster ServiceMesh# bash curl.sh &1 2924rootmaster ServiceMesh# cat destination-rule-all.yamlapiVersion: networking.istio.io/v1alpha3kind: DestinationRulemetadata: name: productpagespec: host: productpage subsets: - name: v1 labels: version: v1(“”請(qǐng)學(xué)生自行手打,不要復(fù)制)apiVersion: networking.istio.io/v1alpha3ki
10、nd: DestinationRulemetadata: name: reviewsspec: host: reviews subsets: - name: v1 labels: version: v1 - name: v2 labels: version: v2 - name: v3 labels: version: v3(“”請(qǐng)學(xué)生自行手打,不要復(fù)制)apiVersion: networking.istio.io/v1alpha3kind: DestinationRulemetadata: name: ratingsspec: host: ratings subsets: - name:
11、v1 labels: version: v1 - name: v2 labels: version: v2 - name: v2-mysql labels: version: v2-mysql - name: v2-mysql-vm labels: version: v2-mysql-vm(“”請(qǐng)學(xué)生自行手打,不要復(fù)制)apiVersion: networking.istio.io/v1alpha3kind: DestinationRulemetadata: name: detailsspec: host: details subsets: - name: v1 labels: version
12、: v1 - name: v2 labels: version: v2rootmaster ServiceMesh# kubectl apply -f destination-rule-all.yamlrootmaster ServiceMesh# kubectl get destinationruleNAME HOST AGEdetails details 21sproductpage productpage 21sratings ratings 21sreviews reviews 21srootmaster ServiceMesh# cat bookinfo/bookinfo.yaml
13、| istioctl kube-inject -f - | kubectl apply -l app=productf -service/productpage unchangeddeployment.apps/productv1 configuredrootmaster ServiceMesh# kubectl get podsNAME READY STATUS RESTARTS AGEdetails-v1-79f774bdb9-np7tt 1/1 Running 0 8m9sproductv1-599f9dc7b8-btdqz 2/2 Running 0 43sratings-v1-b69
14、94bb9-nkq7z 1/1 Running 0 8m9sreviews-v1-545db77b95-xwnwf 1/1 Running 0 8m9srootmaster ServiceMesh# cat bookinfo/bookinfo.yaml | istioctl kube-inject -f - | kubectl apply -l app!=productf rootmaster ServiceMesh# kubectl get podsNAME READY STATUS RESTARTS AGEdetails-v1-6df75fb475-4stwg 2/2 Running 0
15、70sproductv1-599f9dc7b8-fprwf 2/2 Running 0 5m2sratings-v1-c7b9dfddc-rlmk4 2/2 Running 0 70sreviews-v2-855b56b89-57k67 2/2 Running 0 64srootmaster ServiceMesh# cat bookinfo/reviews-v2.yaml | istioctl kube-inject -f - | kubectl apply -f -rootmaster ServiceMesh# cat bookinfo/reviews-v3.yaml | istioctl
16、 kube-inject -f - | kubectl apply -f rootmaster ServiceMesh# kubectl get podsNAME READY STATUS RESTARTS AGEdetails-v1-6df75fb475-4stwg 2/2 Running 0 5m5sproductv1-599f9dc7b8-fprwf 2/2 Running 0 8m2sratings-v1-c7b9dfddc-rlmk4 2/2 Running 0 5m5sreviews-v2-855b56b89-57k67 2/2 Running 0 5m5sreviews-v2-8
17、55b56b89-49jkx 2/2 Running 0 34sreviews-v3-7b76df6bbb-f6hhp 2/2 Running 0 29srootmaster ServiceMesh# kubectl autoscale deployment reviews-v1 -cpu-percent=50 -min=1 -max=10rootmaster ServiceMesh# kubectl autoscale deployment reviews-v2 -cpu-percent=50 -min=1 -max=10rootmaster ServiceMesh# kubectl aut
18、oscale deployment reviews-v3 -cpu-percent=50 -min=1 -max=10rootmaster ServiceMesh# vi virtual-service-all-v1.yamlapiVersion: networking.istio.io/v1alpha3kind: VirtualServicemetadata: name: productpagespec: hosts: - productpage http: - route: - destination: host: productpage subset: v1(“”請(qǐng)學(xué)生自行手打,不要復(fù)制
19、)apiVersion: networking.istio.io/v1alpha3kind: VirtualServicemetadata: name: reviewsspec: hosts: - reviews http: - route: - destination: host: reviews subset: v1(“”請(qǐng)學(xué)生自行手打,不要復(fù)制)apiVersion: networking.istio.io/v1alpha3kind: VirtualServicemetadata: name: ratingsspec: hosts: - ratings http: - route: -
20、destination: host: ratings subset: v1(“”請(qǐng)學(xué)生自行手打,不要復(fù)制)apiVersion: networking.istio.io/v1alpha3kind: VirtualServicemetadata: name: detailsspec: hosts: - details http: - route: - destination: host: details subset: v1rootmaster ServiceMesh# kubectl apply -f virtual-service-all-v1.yaml working.istio.io/p
21、roductpage working.istio.io/reviews working.istio.io/ratings working.istio.io/details createdrootmaster ServiceMesh# vi virtual-service-reviews-50-50.yaml apiVersion: networking.istio.io/v1alpha3kind: VirtualServicemetadata: name: reviewsspec: hosts: - reviews http: - route: - destination: host: reviews subset: v1 weight: 50 - destination: host: reviews subset: v3 weight: 50rootmaster ServiceMesh# kubectl apply -f working.istio.io/rev
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 肉類購(gòu)貨協(xié)議書
- 現(xiàn)金補(bǔ)償協(xié)議書
- 罷訪息訴協(xié)議書
- 脫歐后備協(xié)議書
- 樣板間軟裝銷售協(xié)議書
- 和好朋友做生意協(xié)議書
- 房屋過(guò)度費(fèi)補(bǔ)償協(xié)議書
- 送養(yǎng)子女協(xié)議書
- 環(huán)境建設(shè)協(xié)議書
- 幼兒放學(xué)后托管協(xié)議書
- GB/T 38215-2019結(jié)構(gòu)波紋管用熱軋鋼帶
- 四六級(jí)英語(yǔ)寫作考試輔導(dǎo)資料課件
- 交流電機(jī)理論分析
- 真石漆飾面工程檢驗(yàn)批質(zhì)量驗(yàn)收記錄
- 婦產(chǎn)科手術(shù)配合課件
- (中職)中國(guó)稅收:稅費(fèi)計(jì)算與申報(bào)項(xiàng)目十四 企業(yè)所得稅計(jì)算與申報(bào)課件
- 心理照護(hù)教材課件匯總完整版ppt全套課件最全教學(xué)教程整本書電子教案全書教案課件合集
- 男朋友申請(qǐng)表
- 高中心理健康:我心換你心——心理主題:人際交往 課件(22張PPT)
- 高清元素周期表(專業(yè)版)
- 北京中考英語(yǔ)作文模板
評(píng)論
0/150
提交評(píng)論