版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
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: - *(“”請學生自行手打,不要復制)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(“”請學生自行手打,不要復制)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(“”請學生自行手打,不要復制)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(“”請學生自行手打,不要復制)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(“”請學生自行手打,不要復制
19、)apiVersion: networking.istio.io/v1alpha3kind: VirtualServicemetadata: name: reviewsspec: hosts: - reviews http: - route: - destination: host: reviews subset: v1(“”請學生自行手打,不要復制)apiVersion: networking.istio.io/v1alpha3kind: VirtualServicemetadata: name: ratingsspec: hosts: - ratings http: - route: -
20、destination: host: ratings subset: v1(“”請學生自行手打,不要復制)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)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 二零二五年度木制玩具設計與制造木工分包合同范本4篇
- 2025年度內(nèi)墻膩子施工技術培訓與推廣合同2篇
- 二零二五年度全國連鎖培訓學校股權合作框架合同
- 課題申報參考:岷江流域西南官話語法內(nèi)部差異及歷史演變研究
- 2025版二零二五年度教育信息化項目實施合同范本3篇
- 二零二五年度工業(yè)用地面積調(diào)整補充合同4篇
- 二零二五年度農(nóng)民工就業(yè)創(chuàng)業(yè)扶持政策合作協(xié)議2篇
- 2025年度國產(chǎn)嬰幼兒奶粉品牌全國分銷合同4篇
- 基于大數(shù)據(jù)分析的2025年度農(nóng)產(chǎn)品市場需求預測合同2篇
- 二零二五年度住宅室內(nèi)軟裝搭配合同4篇
- 小紅書違禁詞清單(2024年)
- 《社區(qū)康復》課件-第三章 社區(qū)康復的實施
- 胰島素注射的護理
- 云南省普通高中學生綜合素質(zhì)評價-基本素質(zhì)評價表
- 2024年消防產(chǎn)品項目營銷策劃方案
- 聞道課件播放器
- 03軸流式壓氣機b特性
- 五星級酒店收入測算f
- 大數(shù)據(jù)與人工智能ppt
- 人教版八年級下冊第一單元英語Unit1 單元設計
- GB/T 9109.5-2017石油和液體石油產(chǎn)品動態(tài)計量第5部分:油量計算
評論
0/150
提交評論