版權(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ù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024年廠房轉(zhuǎn)租賃協(xié)議范本
- 2024年度公司車輛租賃協(xié)議樣本
- 2024道路安全員招聘協(xié)議樣本
- 2024年聘用協(xié)議規(guī)范化樣本
- 2023-2024學(xué)年鄭州市高三下學(xué)期5月月考數(shù)學(xué)試題(A卷)
- 2024安全生產(chǎn)與環(huán)保綜合管理協(xié)議
- 二手車交易過(guò)戶協(xié)議范本2024
- 2024年度專項(xiàng)宣傳品訂制協(xié)議
- 2024年項(xiàng)目實(shí)施階段服務(wù)協(xié)議范本
- 天津市河北區(qū)2024-2025學(xué)年高二上學(xué)期11月期中英語(yǔ)試題(無(wú)答案)
- 巖溶地區(qū)建筑地基基礎(chǔ)技術(shù)規(guī)范
- 促銷與促銷組合策略
- 焊工施工方案
- 新版pep小學(xué)英語(yǔ)三四年級(jí)教材解讀
- 人教版(新插圖)二年級(jí)上冊(cè)數(shù)學(xué) 第3課時(shí) 銳角、鈍角的認(rèn)識(shí) 教學(xué)課件
- 山東省濟(jì)南市市中區(qū)實(shí)驗(yàn)中學(xué)2024屆高二物理第一學(xué)期期中達(dá)標(biāo)測(cè)試試題含解析
- 數(shù)據(jù)清洗課件-第4章-數(shù)據(jù)采集與抽取
- 2023年新改版青島版(六三制)四年級(jí)上冊(cè)科學(xué)全冊(cè)精編知識(shí)點(diǎn)梳理
- GB/T 16935.1-2023低壓供電系統(tǒng)內(nèi)設(shè)備的絕緣配合第1部分:原理、要求和試驗(yàn)
- 工廠倉(cāng)庫(kù)管理方法范本
評(píng)論
0/150
提交評(píng)論