




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
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: - *(“”請學(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(“”請學(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(“”請學(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(“”請學(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(“”請學(xué)生自行手打,不要復(fù)制
19、)apiVersion: networking.istio.io/v1alpha3kind: VirtualServicemetadata: name: reviewsspec: hosts: - reviews http: - route: - destination: host: reviews subset: v1(“”請學(xué)生自行手打,不要復(fù)制)apiVersion: networking.istio.io/v1alpha3kind: VirtualServicemetadata: name: ratingsspec: hosts: - ratings http: - route: -
20、destination: host: ratings subset: v1(“”請學(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. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- ipfs礦機合同范例
- 信托通道業(yè)務(wù)合同范例
- 普魯蘭多糖-海藻酸鈉復(fù)合膜在柑橘果實防腐保鮮作用中的研究
- 雙腿輪式機器人復(fù)雜運動控制算法設(shè)計
- 體型參數(shù)對旋流排沙渠道水沙特性的影響
- 辦公飲品售賣合同范例
- 礦井水中典型有機污染物風(fēng)險評估及光化學(xué)降解技術(shù)研究
- 過渡族金屬有機框架納米陣列的電催化及光輔助電催化性能研究
- 健身房員工合同范例
- 公司采購合同范例6
- SB-T 11238-2023 報廢電動汽車回收拆解技術(shù)要求
- 《商朝的發(fā)展》課件
- 開題報告-基于單片機的溫度控制系統(tǒng)設(shè)計
- 北師版四下數(shù)學(xué)數(shù)學(xué)好玩教材分析公開課課件教案
- 山羊傳染性胸膜肺炎的防治
- 設(shè)計交底與圖紙會審會議紀(jì)要
- 北師大版完整版英語完形填空練習(xí)題40篇
- 統(tǒng)編版語文三年級上冊期中課外閱讀大闖關(guān)(含答案)
- 多樣生態(tài)茶園建設(shè)方案
- 電子商務(wù)專升本考試(習(xí)題卷7)
- 莖木類中藥鑒定技術(shù)-通草、鉤藤的鑒定
評論
0/150
提交評論