国产精品chinese,色综合天天综合精品网国产在线,成午夜免费视频在线观看,清纯女学生被强行糟蹋小说

    <td id="ojr13"><tr id="ojr13"><label id="ojr13"></label></tr></td>
        • <source id="ojr13"></source>
            <td id="ojr13"><ins id="ojr13"><label id="ojr13"></label></ins></td>

            Article / 文章中心

            KubeVela + ASM 云原生交付體驗(yàn)

            發(fā)布時(shí)間:2021-11-25 點(diǎn)擊數(shù):744

            前提條件
            ● 已創(chuàng)建ASM實(shí)例,且ASM實(shí)例的Istio為1.9.7.93及以上版本。具體操作,請參見創(chuàng)建ASM實(shí)例。
            ● 已創(chuàng)建ACK集群。具體操作,請參見創(chuàng)建Kubernetes托管版集群。
            ● 添加集群到ASM實(shí)例。具體操作,請參見添加集群到ASM實(shí)例。
            步驟一:啟用數(shù)據(jù)面集群KubeAPI訪問Istio資源功能

            1. 登錄ASM控制臺(tái)。
            2. 在左側(cè)導(dǎo)航欄,選擇服務(wù)網(wǎng)格 > 網(wǎng)格管理。
            3. 在網(wǎng)格管理頁面,找到待配置的實(shí)例,單擊實(shí)例的名稱或在操作列中單擊管理。
            4. 在網(wǎng)格信息頁面單擊右上角的功能設(shè)置。
            5. 在功能設(shè)置更新面板選中啟用數(shù)據(jù)面集群KubeAPI訪問Istio資源,然后單擊確定。

            步驟二:獲取asm-cr-aggregation配置信息

            1. 查看ASM實(shí)例ID。
              a. 登錄ASM控制臺(tái)。
              b. 在左側(cè)導(dǎo)航欄,選擇服務(wù)網(wǎng)格 > 網(wǎng)格管理。
              c. 在網(wǎng)格管理頁面,找到待配置的實(shí)例,單擊實(shí)例的名稱或在操作列中單擊管理。在網(wǎng)格信息頁面查看ASM實(shí)例ID。
            2. 查看集群地域ID。
              a. 登錄容器服務(wù)管理控制臺(tái)。
              b. 在控制臺(tái)左側(cè)導(dǎo)航欄單擊集群。在集群頁面查看目標(biāo)集群的地域,例如您集群地域?yàn)槿A北2(北京),則集群地域ID為cn-beijing。
            3. 查看AccessKey ID和AccessKey Secret。具體操作,請參見獲取AccessKey。

            步驟三:安裝asm-cr-aggregation

            1. 通過cloudshell連接集群
            2. 下載并解壓至asm-cr-aggregation本地。

            curl -O -L https://alibabacloudservicemesh.oss-cn-beijing.aliyuncs.com/asm-helmcharts/asm-cr-aggregation.tgz
            tar xvf asm-cr-aggregation.tgz

            1. 進(jìn)入asm-cr-aggregation文件夾中,找到values.yaml文件,在values.yaml文件中補(bǔ)充ASM ID、集群地域ID、AccessKey ID和AccessKey Secret,修改repository為registry-vpc.cn-shenzhen.aliyuncs.com/ali-workshop/asm-craggregation-apiservice,然后保存values.yaml文件。
            2. 執(zhí)行以下命令,安裝asm-cr-aggregation。

            helm upgrade -i -f values.yaml asm-cr-aggregation ./

            1. 驗(yàn)證asm-cr-aggregation是否安裝成功。
              a. 登錄容器服務(wù)管理控制臺(tái)。
              b. 在控制臺(tái)左側(cè)導(dǎo)航欄中,單擊集群。
              c. 在集群列表頁面中,單擊目標(biāo)集群名稱或者目標(biāo)集群右側(cè)操作列下的詳情。
              d. 在集群管理頁面左側(cè)導(dǎo)航欄選擇應(yīng)用 > Helm。在Helm頁面可以看到asm-cr-aggregation,說明asm-cr-aggregation安裝成功。

            步驟四:授予RAM用戶權(quán)限
            使用數(shù)據(jù)面集群Kubernetes API訪問Istio資源之前,您的賬號(hào)需要擁有在數(shù)據(jù)面集群訪問Istio資源的權(quán)限和ASM的自定義資源權(quán)限:

            授予RAM用戶訪問Istio資源的讀寫權(quán)限。

            1. 使用阿里云賬號(hào)登錄容器服務(wù)管理控制臺(tái)。
            2. 在控制臺(tái)左側(cè)導(dǎo)航欄單擊授權(quán)管理。
            3. 在子賬號(hào)頁簽下單擊目標(biāo)RAM用戶右側(cè)的管理權(quán)限。
            4. 在集群RBAC配置頁面中單擊“+”圖標(biāo),選擇要授予的集群和命名空間,設(shè)置訪問權(quán)限為自定義,在文本框中選擇asm-istio-admin,然后單擊下一步。
            5. 驗(yàn)證RAM用戶是否擁有訪問Istio資源的讀寫權(quán)限。
              a. 執(zhí)行以下命令,查看虛擬服務(wù)。

            kubectl get VirtualService
            預(yù)期輸出:
            NAME CREATED AT
            reviews-route 2021-11-15T07:09:10Z
            b. 執(zhí)行以下命令,編輯虛擬服務(wù)。
            kubectl edit VirtualService reviews-route
            預(yù)期輸出:
            virtualservice.networking.istio.io/reviews-route edited
            步驟五:安裝KubeVela

            1. 登錄容器服務(wù)管理控制臺(tái)。
            2. 在控制臺(tái)左側(cè)導(dǎo)航欄中,選擇市場 > 應(yīng)用目錄。
            3. 在應(yīng)用目錄頁面搜索ack-kubevela,然后單擊ack-kubevela。
            4. 修改兩個(gè)image,指向深圳的內(nèi)網(wǎng)倉庫:
              a. registry-vpc.cn-shenzhen.aliyuncs.com/ali-workshop/vela-core
              b. registry-vpc.cn-shenzhen.aliyuncs.com/ali-workshop/kube-webhook-certgen
            5. 在ack-kubevela詳情頁面創(chuàng)建面板選擇集群,然后單擊創(chuàng)建。

            步驟六:部署Kebuvla配置文件

            1. 下載操作文件

            curl -O -L https://aliware-images.oss-cn-hangzhou.aliyuncs.com/ASM/Istio%E8%B5%84%E6%BA%90%E5%AE%89%E8%A3%85%E5%8C%85/asm_kubevela.zip
            unzip asm_kubevela.zip

            1. 進(jìn)入asm_kubevela文件夾中,執(zhí)行以下命令,逐個(gè)部署Kebuvla配置文件。

            kubectl apply -f rollback-wf-def.yaml
            kubectl apply -f canary-rollout-wf-def.yaml
            kubectl apply -f traffic-trait-def.yaml
            步驟七:部署應(yīng)用和網(wǎng)關(guān)

            1. 進(jìn)入asm_kubevela文件夾中,執(zhí)行以下命令,部署B(yǎng)ookinfo應(yīng)用。application.yaml文件中為review服務(wù)配置traits字段下type為canary-traffic,表示配置了漸進(jìn)式流量發(fā)布的運(yùn)維特征。

            kubectl apply -f - << EOF
            apiVersion: core.oam.dev/v1beta1
            kind: Application
            metadata:
            name: book-info
            namespace: default
            spec:
            components:

            - name: reviews type: webservice properties: image: registry-vpc.cn-shenzhen.aliyuncs.com/ali-workshop/examples-bookinfo-reviews-v2:1.16.2 port: 9080 volumes: - name: wlp-output type: emptyDir mountPath: /opt/ibm/wlp/output - name: tmp type: emptyDir mountPath: /tmp traits: - type: canary-traffic properties: port: - 9080 - type: rollout properties: targetSize: 2 # This means to rollout two more replicas in two batches. rolloutBatches: - replicas: 2 - name: productpage type: webservice properties: image: registry-vpc.cn-shenzhen.aliyuncs.com/ali-workshop/examples-bookinfo-productpage-v1:1.16.2 port: 9080 traits: - type: expose properties: port: - 9080 - name: ratings type: webservice properties: image: registry-vpc.cn-shenzhen.aliyuncs.com/ali-workshop/examples-bookinfo-ratings-v1:1.16.2 port: 9080 traits: - type: expose properties: port: - 9080 - name: details type: webservice properties: image: registry-vpc.cn-shenzhen.aliyuncs.com/ali-workshop/examples-bookinfo-details-v1:1.16.2 port: 9080 traits: - type: expose properties: port: - 9080

            EOF

            1. 在ASM控制臺(tái)中部署網(wǎng)關(guān)規(guī)則和虛擬服務(wù)。
              a. 登錄ASM控制臺(tái)。
              b. 在左側(cè)導(dǎo)航欄,選擇服務(wù)網(wǎng)格 > 網(wǎng)格管理。
              c. 在網(wǎng)格管理頁面,找到待配置的實(shí)例,單擊實(shí)例的名稱或在操作列中單擊管理。
              d. 部署網(wǎng)關(guān)規(guī)則。
              ⅰ. 在網(wǎng)格詳情頁面左側(cè)導(dǎo)航欄選擇流量管理 > 網(wǎng)關(guān)規(guī)則,在右側(cè)頁面單擊使用YAML創(chuàng)建。
              ⅱ. 在創(chuàng)建頁面設(shè)置命名空間為default,復(fù)制以下內(nèi)容到文本框中,然后單擊創(chuàng)建。

            apiVersion: networking.istio.io/v1alpha3
            kind: Gateway
            metadata:
            name: bookinfo-gateway
            spec:
            selector:

            istio: ingressgateway # use istio default controller

            servers:

            • port:

              number: 80 name: http protocol: HTTP

              hosts:

              • "*"

            e. 部署虛擬服務(wù)。

            ⅰ. 在網(wǎng)格詳情頁面左側(cè)導(dǎo)航欄選擇流量管理 > 虛擬服務(wù),在右側(cè)頁面單擊使用YAML創(chuàng)建。
            ⅱ. 在創(chuàng)建頁面設(shè)置命名空間為default,復(fù)制以下內(nèi)容到文本框中,然后單擊確定。

            apiVersion: networking.istio.io/v1alpha3
            kind: VirtualService
            metadata:
            name: bookinfo
            spec:
            hosts:

            • "*"

            gateways:

            • bookinfo-gateway

            http:

            • match:

              • uri:
                exact: /productpage
              • uri:
                prefix: /static
              • uri:
                exact: /login
              • uri:
                exact: /logout
              • uri:
                prefix: /api/v1/products

              route:

              • destination:
                host: productpage
                port:
                number: 9080
            1. 訪問Bookinfo應(yīng)用。
              a. 登錄容器服務(wù)管理控制臺(tái)。
              b. 在控制臺(tái)左側(cè)導(dǎo)航欄中,單擊集群。
              c. 在集群列表頁面中,單擊目標(biāo)集群名稱或者目標(biāo)集群右側(cè)操作列下的詳情。
              d. 在集群管理頁面選擇網(wǎng)絡(luò) > 服務(wù)。
              e. 在服務(wù)頁面頂部設(shè)置命名空間為istio-system,查看istio-ingressgateway右側(cè)80端口的外部端點(diǎn),然后在瀏覽器地址欄中輸入80端口的入口網(wǎng)關(guān)地址/productpage,訪問Bookinfo應(yīng)用。多次刷新頁面,可以看到頁面上顯示黑色星星。

            步驟八:漸進(jìn)式發(fā)布應(yīng)用

            1. 執(zhí)行以下命令,升級(jí)reviews應(yīng)用,并調(diào)整流量。

            kubectl apply -f - << EOF
            apiVersion: core.oam.dev/v1beta1
            kind: Application
            metadata:
            name: book-info
            namespace: default
            spec:
            components:

            - name: reviews type: webservice properties: image: registry-vpc.cn-shenzhen.aliyuncs.com/ali-workshop/examples-bookinfo-reviews-v3:1.16.2 port: 9080 volumes: - name: wlp-output type: emptyDir mountPath: /opt/ibm/wlp/output - name: tmp type: emptyDir mountPath: /tmp traits: - type: canary-traffic properties: port: - 9080 - type: rollout properties: targetSize: 2 # This means to rollout two more replicas in two batches. rolloutBatches: - replicas: 1 - replicas: 1 - name: productpage type: webservice properties: image: registry-vpc.cn-shenzhen.aliyuncs.com/ali-workshop/examples-bookinfo-productpage-v1:1.16.2 port: 9080 traits: - type: expose properties: port: - 9080 - name: ratings type: webservice properties: image: registry-vpc.cn-shenzhen.aliyuncs.com/ali-workshop/examples-bookinfo-ratings-v1:1.16.2 port: 9080 traits: - type: expose properties: port: - 9080 - name: details type: webservice properties: image: registry-vpc.cn-shenzhen.aliyuncs.com/ali-workshop/examples-bookinfo-details-v1:1.16.2 port: 9080 traits: - type: expose properties: port: - 9080 

            workflow:

            steps:
              - name: rollout-1st-batch
                type: canary-rollout
                properties:
                  # just upgrade first batch of component
                  batchPartition: 0
                  traffic:
                    weightedTargets:
                      - revision: reviews-v1
                        weight: 90 # 90% shift to new version
                      - revision: reviews-v2
                        weight: 10 # 10% shift to new version
            
              # give user time to verify part of traffic shifting to newRevision
              - name: manual-approval
                type: suspend
            
              - name: rollout-rest
                type: canary-rollout
                properties:
                  # upgrade all batches of component
                  batchPartition: 1
                  traffic:
                    weightedTargets:
                      - revision: reviews-v2
                        weight: 100 # 100% shift to new version

            EOF
            a. targetSize:升級(jí)實(shí)例的批次。
            b. rolloutBatches:每批實(shí)例升級(jí)的個(gè)數(shù)。
            c. 在application_rollout-v2.yaml文件中設(shè)置了以下三個(gè)執(zhí)行工作流:

            ⅰ. 設(shè)置batchPartition等于0,表示只升級(jí)第一批次實(shí)例,即將reviews服務(wù)的2個(gè)Pod中,只升級(jí)其中的1個(gè)Pod。然后設(shè)置traffic.weightedTargets參數(shù),將10%流量導(dǎo)向新升級(jí)的reviews服務(wù),90%的流量仍然流向舊版本的服務(wù)。
            ⅱ. 設(shè)置type為suspend,完成第一步工作流后,將暫停工作流。
            ⅲ. 設(shè)置batchPartition等于1,表示升級(jí)第二批次實(shí)例,即將reviews服務(wù)的2個(gè)Pod都升級(jí)到v3版本鏡像。然后設(shè)置traffic.weightedTargets參數(shù),將100%流量導(dǎo)向新升級(jí)的reviews服務(wù)。
            1. 在瀏覽器地址欄中輸入80端口的入口網(wǎng)關(guān)地址/productpage,訪問Bookinfo應(yīng)用。多次刷新頁面,10%概率可以看到紅色星星,90%概率看到黑色星星。
            2. 執(zhí)行以下命令,繼續(xù)執(zhí)行工作流,使reviews服務(wù)全部升級(jí)到v3版本。

            curl -O https://ali-workshop.oss-cn-shenzhen.aliyuncs.com/vela
            chmod +x vela
            ./vela workflow resume book-info

            1. 在瀏覽器地址欄中輸入80端口的入口網(wǎng)關(guān)地址/productpage,訪問Bookinfo應(yīng)用。多次刷新頁面,頁面上只顯示紅色星星。說明reviews服務(wù)全部升級(jí)到v3版本。

            (可選)步驟九:回滾應(yīng)用
            如果發(fā)現(xiàn)發(fā)布的新版本應(yīng)用不符合預(yù)期,您可以終止發(fā)布工作流量,并將應(yīng)用回滾到之前的版本。

            1. 執(zhí)行以下命令,回滾應(yīng)用。

            kubectl apply -f - << EOF
            apiVersion: core.oam.dev/v1beta1
            kind: Application
            metadata:
            name: book-info
            namespace: default
            spec:
            components:

            - name: reviews type: webservice properties: image: registry-vpc.cn-shenzhen.aliyuncs.com/ali-workshop/examples-bookinfo-reviews-v3:1.16.2 port: 9080 volumes: - name: wlp-output type: emptyDir mountPath: /opt/ibm/wlp/output - name: tmp type: emptyDir mountPath: /tmp traits: - type: canary-traffic properties: port: - 9080 - type: rollout properties: targetSize: 2 # This means to rollout two more replicas in two batches. rolloutBatches: - replicas: 1 - replicas: 1 - name: productpage type: webservice properties: image: registry-vpc.cn-shenzhen.aliyuncs.com/ali-workshop/examples-bookinfo-productpage-v1:1.16.2 port: 9080 traits: - type: expose properties: port: - 9080 - name: ratings type: webservice properties: image: registry-vpc.cn-shenzhen.aliyuncs.com/ali-workshop/examples-bookinfo-ratings-v1:1.16.2 port: 9080 traits: - type: expose properties: port: - 9080 - name: details type: webservice properties: image: registry-vpc.cn-shenzhen.aliyuncs.com/ali-workshop/examples-bookinfo-details-v1:1.16.2 port: 9080 traits: - type: expose properties: port: - 9080 

            workflow:

            steps:
              - name: rollback type: canary-rollback

            EOF

            1. 在rollback.yaml文件中設(shè)置type為canary-rollback,會(huì)自動(dòng)進(jìn)行以下操作:
              a. 更新Rollout對(duì)象的targetRevisionName成舊的版本,自動(dòng)回滾所有已發(fā)布的新版本的實(shí)例回到舊版本,并且保持還沒升級(jí)的舊版本實(shí)例。
              b. 更新VirtualService對(duì)象的route字段,將所有流量導(dǎo)向舊的版本。
              c. 更新DestinationRule對(duì)象的subset字段,只容納舊的版本。
            2. 在瀏覽器地址欄中輸入80端口的入口網(wǎng)關(guān)地址/productpage,訪問Bookinfo應(yīng)用。多次刷新頁面,頁面上只顯示黑色星星。說明reviews服務(wù)回滾到v2版本。