<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # Incremental Rollouts with GitLab CI/CD > 原文:[https://docs.gitlab.com/ee/ci/environments/incremental_rollouts.html](https://docs.gitlab.com/ee/ci/environments/incremental_rollouts.html) * [Manual Rollouts](#manual-rollouts) * [Timed Rollouts](#timed-rollouts) * [Blue-Green Deployment](#blue-green-deployment) # Incremental Rollouts with GitLab CI/CD[](#incremental-rollouts-with-gitlab-cicd "Permalink") 在對應用程序進行更改時,可以將生產更改僅發布到 Kubernetes 吊艙的一部分,作為降低風險的策略. 通過逐步發布生產更改,可以監視錯誤率或性能下降,并且如果沒有問題,則可以更新所有吊艙. manbetx 客戶端打不開支持使用增量卷展到 Kubernetes 生產系統的手動觸發和定時卷展. 使用"手動卷展"時,將手動觸發每個吊艙的釋放,而在"定時卷展"中,默認的暫停時間為 5 分鐘,然后按批次進行釋放. 也可以在暫停時間到期之前手動觸發定時啟動. 手動和定時卷展欄自動包含在由[AutoDevOps](../../topics/autodevops/index.html)控制的項目中,但也可以通過 GitLab CI / CD 在`.gitlab-ci.yml`配置文件中`.gitlab-ci.yml`配置. 可以使用" [持續交付"](../introduction/index.html#continuous-delivery)方法來實現手動觸發的部署,而定時部署不需要干預,并且可以作為" [持續部署"](../introduction/index.html#continuous-deployment)策略的一部分. 您還可以通過自動部署應用程序的方式將兩者結合在一起,除非最終在必要時進行手動干預. 我們創建了示例應用程序來演示這三個選項,您可以將其用作構建自己的示例: * [Manual incremental rollouts](https://gitlab.com/gl-release/incremental-rollout-example/blob/master/.gitlab-ci.yml) * [Timed incremental rollouts](https://gitlab.com/gl-release/timed-rollout-example/blob/master/.gitlab-ci.yml) * [Both manual and timed rollouts](https://gitlab.com/gl-release/incremental-timed-rollout-example/blob/master/.gitlab-ci.yml) ## Manual Rollouts[](#manual-rollouts "Permalink") 在 GitLab 10.8 中[引入](https://gitlab.com/gitlab-org/gitlab/-/issues/5415) . 可以將 GitLab 配置為通過`.gitlab-ci.yml`手動進行增量部署. 手動配置允許對該功能進行更多控制. 增量部署的步驟取決于為部署定義的 Pod 數量,這些 Pod 是在創建 Kubernetes 集群時配置的. 例如,如果您的應用程序有 10 個容器,并且運行了 10%的部署作業,則該應用程序的新實例將被部署到單個容器中,而其余 9 個將顯示前一個實例. 首先,我們[將模板定義為手動](https://gitlab.com/gl-release/incremental-rollout-example/blob/master/.gitlab-ci.yml#L100-103) : ``` .manual_rollout_template: &manual_rollout_template <<: *rollout_template stage: production when: manual ``` 然后,我們[定義每個步驟的推出量](https://gitlab.com/gl-release/incremental-rollout-example/blob/master/.gitlab-ci.yml#L152-155) : ``` rollout 10%: <<: *manual_rollout_template variables: ROLLOUT_PERCENTAGE: 10 ``` When the jobs are built, a **play** button will appear next to the job’s name. Click the **play** button to release each stage of pods. You can also rollback by running a lower percentage job. Once 100% is reached, you cannot roll back using this method. It is still possible to roll back by redeploying the old version using the **Rollback** button on the environment page. [![Play button](https://img.kancloud.cn/7c/8f/7c8ff2a2740722e25b8bd857babfc954_1502x524.png)](img/incremental_rollouts_play_v12_7.png) 一個[可部署的應用程序](https://gitlab.com/gl-release/incremental-rollout-example)可用,演示了手動觸發的增量部署. ## Timed Rollouts[](#timed-rollouts "Permalink") 在 GitLab 11.4 中[引入](https://gitlab.com/gitlab-org/gitlab/-/issues/7545) . 定時部署的行為與手動部署的行為相同,不同之處在于,每個作業在部署前都會延遲幾分鐘. 單擊作業將顯示倒計時. [![Timed rollout](https://img.kancloud.cn/21/da/21da91869b8f9e599a4ea849ccb5e11d_1806x408.png)](img/timed_rollout_v12_7.png) 可以將此功能與手動增量部署相結合,以便作業倒計時然后部署. 首先,我們[將模板定義為 timed](https://gitlab.com/gl-release/timed-rollout-example/blob/master/.gitlab-ci.yml#L86-89) : ``` .timed_rollout_template: &timed_rollout_template <<: *rollout_template when: delayed start_in: 1 minutes ``` 我們可以使用`start_in`鍵定義延遲時間: ``` start_in: 1 minutes ``` 然后,我們[定義每個步驟的推出量](https://gitlab.com/gl-release/timed-rollout-example/blob/master/.gitlab-ci.yml#L97-101) : ``` timed rollout 30%: <<: *timed_rollout_template stage: timed rollout 30% variables: ROLLOUT_PERCENTAGE: 30 ``` 一個[可部署的應用程序](https://gitlab.com/gl-release/timed-rollout-example)可用, [演示了定時部署的配置](https://gitlab.com/gl-release/timed-rollout-example/blob/master/.gitlab-ci.yml#L86-95) . ## Blue-Green Deployment[](#blue-green-deployment "Permalink") 有時也稱為 A / B 部署或紅黑色部署,此技術用于減少部署期間的停機時間和風險. 當與增量推出結合使用時,您可以最大程度地減少導致問題的部署的影響. 使用這種技術,有兩種部署方式("藍色"和"綠色",但是可以使用任何命名). 在任何給定時間,這些部署中只有一個處于活動狀態,除非在增量部署期間. 例如,您的藍色部署當前可以在生產中處于活動狀態,而綠色部署"處于活動狀態"可以進行測試,但不能部署到生產中. 如果發現問題,則可以在不影響生產部署的情況下更新綠色部署(當前為藍色). 如果測試沒有問題,則將生產切換到綠色部署,并且藍色現在可用于測試下一個版本. 此過程減少了停機時間,因為無需停止生產部署即可切換到其他部署. 兩種部署都并行運行,并且可以隨時切換到. 提供了一個[示例可部署應用程序](https://gitlab.com/gl-release/blue-green-example) ,帶有一個[`gitlab-ci.yml` CI / CD 配置文件](https://gitlab.com/gl-release/blue-green-example/blob/master/.gitlab-ci.yml) ,該[文件](https://gitlab.com/gl-release/blue-green-example/blob/master/.gitlab-ci.yml)演示了藍綠色的部署.
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看