コンテンツにスキップ
Kong Logo | Kong Docs Logo
  • ドキュメント
    • API仕様を確認する
      View all API Specs すべてのAPI仕様を表示 View all API Specs arrow image
    • ドキュメンテーション
      API Specs
      Kong Gateway
      軽量、高速、柔軟なクラウドネイティブAPIゲートウェイ
      Kong Konnect
      SaaSのエンドツーエンド接続のための単一プラットフォーム
      Kong AI Gateway
      GenAI インフラストラクチャ向けマルチ LLM AI Gateway
      Kong Mesh
      Kuma と Envoy をベースにしたエンタープライズサービスメッシュ
      decK
      Kongの構成を宣言型で管理する上で役立ちます
      Kong Ingress Controller
      Kubernetesクラスタ内で動作し、Kongをプロキシトラフィックに設定する
      Kong Gateway Operator
      YAMLマニフェストを使用してKubernetes上のKongデプロイメントを管理する
      Insomnia
      コラボレーティブAPI開発プラットフォーム
  • Plugin Hub
    • Plugin Hubを探索する
      View all plugins すべてのプラグインを表示 View all plugins arrow image
    • 機能性 すべて表示 View all arrow image
      すべてのプラグインを表示
      AI's icon
      AI
      マルチ LLM AI Gatewayプラグインを使用してAIトラフィックを管理、保護、制御する
      認証's icon
      認証
      認証レイヤーでサービスを保護する
      セキュリティ's icon
      セキュリティ
      追加のセキュリティレイヤーでサービスを保護する
      トラフィック制御's icon
      トラフィック制御
      インバウンドおよびアウトバウンドAPIトラフィックの管理、スロットル、制限
      サーバーレス's icon
      サーバーレス
      他のプラグインと組み合わせてサーバーレス関数を呼び出します
      分析と監視's icon
      分析と監視
      APIとマイクロサービストラフィックを視覚化、検査、監視
      変革's icon
      変革
      Kongでリクエストとレスポンスをその場で変換
      ログ記録's icon
      ログ記録
      インフラストラクチャに最適なトランスポートを使用して、リクエストと応答データをログに記録します
  • サポート
  • コミュニティ
  • Kongアカデミー
デモを見る 無料トライアルを開始
1.0.x
  • Home icon
  • Kong Gateway Operator
  • Guides
  • Upgrade
  • Data Plane
  • Blue/Green Upgrades
report-issue問題を報告する
  • Kong Gateway
  • Kong Konnect
  • Kong Mesh
  • Kong AI Gateway
  • Plugin Hub
  • decK
  • Kong Ingress Controller
  • Kong Gateway Operator
  • Insomnia
  • Kuma

  • ドキュメント投稿ガイドライン
  • 1.5.x (latest)
  • 1.4.x
  • 1.3.x
  • 1.2.x
  • 1.1.x
  • 1.0.x
  • Introduction
    • Overview
    • Deployment Topologies
      • Hybrid Mode
      • DB-less Mode
    • Key Concepts
      • Gateway API
      • Gateway Configuration
    • Changelog
    • Version Support Policy
    • FAQ
  • Get Started
    • Konnect
      • Install Gateway Operator
      • Deploy a Data Plane
      • Create a Route
    • Kong Ingress Controller
      • Install Gateway Operator
      • Create a Gateway
      • Create a Route
  • Production Deployment
    • Overview
    • Install
    • Monitoring
      • Metrics
    • Upgrade Gateway Operator
  • Guides
    • Customization
      • Set data plane image
      • Deploying Sidecars
      • Customizing PodTemplateSpec
    • Upgrading Data Planes
      • Rolling Deployment
      • Blue / Green Deployment
  • Reference
    • Custom Resources
      • Overview
      • GatewayConfiguration
      • ControlPlane
      • DataPlane
    • License
    • Version Compatibility
enterprise-switcher-icon 次に切り替える: OSS
On this pageOn this page
  • Using DataPlane

このページは、まだ日本語ではご利用いただけません。翻訳中です。

旧バージョンのドキュメントを参照しています。 最新のドキュメントはこちらをご参照ください。

Blue/Green Upgrades

Using DataPlane

Blue/Green upgrades can be accomplished when working with the DataPlane resource directly.

  1. To enable blue/green deployments set the spec.deployment.rollout.strategy on your DataPlane resource:

     apiVersion: gateway-operator.konghq.com/v1beta1
     kind: DataPlane
     metadata:
       name: dataplane-example
     spec:
       deployment:
         rollout:
           strategy:
             blueGreen:
               promotion:
                 strategy: BreakBeforePromotion
         podTemplateSpec:
           spec:
             containers:
             - name: proxy
               image: kong/kong-gateway:3.10.0.1
               env:
               - name: KONG_LOG_LEVEL
                 value: debug
    

    NOTE: Currently only BreakBeforePromotion is available as promotion strategy.

    When applied like this, Kong Gateway Operator will deploy new Services through which you’ll be able to access new Pods once they are available.

    By default no Pods will be deployed immediately, instead Kong Gateway Operator will observe the DataPlane resource for spec changes and when any configuration drift is detected it will spawn a new “preview” Deployment which will contain the changes applied to the DataPlane resource.

  2. Wait for DataPlane to be ready to accept changes

     kubectl wait dataplane dataplane-example --for=jsonpath='{.status.rollout.conditions[*].reason}'=AwaitingPromotion
    
  3. Test it out by patching the DataPlane with a new image:

     kubectl patch dataplane dataplane-example --type='json' -p='[{"op": "replace", "path": "/spec/deployment/podTemplateSpec/spec/containers/0/image", "value":"kong:3.3.1"}]'
    

    The output should look like this:

     dataplane.gateway-operator.konghq.com/dataplane-example patched
    

    After this patch gets applied you’ll be able to access the new Kong Gateway Pods via the “preview” ingress Service.

  4. To find the “preview” Service you can look up DataPlane status, and more specifically its rollout field:

     kubectl get dataplane dataplane-example -o jsonpath-as-json='{.status.rollout}'
    

    The output should look like this:

     [
         {
             "conditions": [
                 {
                     "lastTransitionTime": "2023-09-21T11:40:25Z",
                     "message": "",
                     "observedGeneration": 2,
                     "reason": "AwaitingPromotion",
                     "status": "False",
                     "type": "RolledOut"
                 }
             ],
             "deployment": {
                 "selector": "6cf0d993-2319-43d5-bfdc-e2cadd6bd7e3"
             },
             "services": {
                 "adminAPI": {
                     "addresses": [
                         {
                             "sourceType": "PrivateIP",
                             "type": "IPAddress",
                             "value": "None"
                         }
                     ],
                     "name": "dataplane-admin-dataplane-example-cx6nq"
                 },
                 "ingress": {
                     "addresses": [
                         {
                             "sourceType": "PrivateLoadBalancer",
                             "type": "IPAddress",
                             "value": "172.18.0.101"
                         },
                         {
                             "sourceType": "PrivateIP",
                             "type": "IPAddress",
                             "value": "10.96.28.2"
                         }
                     ],
                     "name": "dataplane-ingress-dataplane-example-2249g"
                 }
             }
         }
     ]
    

    Here you can see the ingress Service name that was created for you to validate the new set of Pods.

    Its addresses (together with their types and sourceTypes) are stored status.rollout.services[].ingress.

    Notice that status.rollout.conditions[] contains a condition with Type RolledOut and Reason set to AwaitingPromotion. This means that everything is ready to promote the DataPlane with staged changes. Before we do so, let’s test it.

  5. You can access the spawned “preview” Service by using its LB address (taken from the status.rollout.services[].ingress.addresses[].value field):

     $ curl -s -D - -o /dev/null 172.18.0.101
     HTTP/1.1 404 Not Found
     Date: Thu, 21 Sep 2023 11:40:26 GMT
     Content-Type: application/json; charset=utf-8
     Connection: keep-alive
     Content-Length: 52
     X-Kong-Response-Latency: 0
     Server: kong/3.3.1
    

    This way we can see that new Kong Gateway Pods have been deployed and are reachable through the “preview” ingress Service using the updated image.

  6. Verify the old Pods are still available and are still serving the traffic. You can verify that by accessing its “live” ingress Service

    We can get its addresses with:

     kubectl get dataplane dataplane-example -o jsonpath-as-json='{.status.addresses}'
    

    The output should look like this:

     [
       [
         {
             "sourceType": "PrivateLoadBalancer",
             "type": "IPAddress",
             "value": "172.18.0.100"
         },
         {
             "sourceType": "PrivateIP",
             "type": "IPAddress",
             "value": "10.96.11.156"
         }
       ],
     ]
    

    Knowing the LoadBalancer IP address is 172.18.0.100, you can issue a request:

     $ curl -s -D - -o /dev/null 172.18.0.100
     HTTP/1.1 404 Not Found
     Date: Thu, 21 Sep 2023 11:40:26 GMT
     Content-Type: application/json; charset=utf-8
     Connection: keep-alive
     Content-Length: 52
     X-Kong-Response-Latency: 0
     Server: kong/3.9.0
    

    As you can see, the live Service is still serving traffic using 3.9.0.

  7. Now you can perform additional validation steps by inspecting the deployed resources.

  8. Once you’ve validated the newly created resources, run kubectl annotate dataplanes.gateway-operator.konghq.com dataplane-example gateway-operator.konghq.com/promote-when-ready=true to allow Kong Gateway Operator to switch the traffic to the new Pods.

    This annotation will automatically be cleared by Kong Gateway Operator once the new Pods are promoted to be live.

  9. Once the promotion concludes, the updated Pods start serving traffic and the old Pods and their Deployment will be deleted to conserve the resources.

Thank you for your feedback.
Was this page useful?
情報が多すぎる場合 close cta icon
Kong Konnectを使用すると、より多くの機能とより少ないインフラストラクチャを実現できます。月額1Mリクエストが無料。
無料でお試しください
  • Kong
    APIの世界を動かす

    APIマネジメント、サービスメッシュ、イングレスコントローラーの統合プラットフォームにより、開発者の生産性、セキュリティ、パフォーマンスを大幅に向上します。

    • 製品
      • Kong Konnect
      • Kong Gateway Enterprise
      • Kong Gateway
      • Kong Mesh
      • Kong Ingress Controller
      • Kong Insomnia
      • 製品アップデート
      • 始める
    • ドキュメンテーション
      • Kong Konnectドキュメント
      • Kong Gatewayドキュメント
      • Kong Meshドキュメント
      • Kong Insomniaドキュメント
      • Kong Konnect Plugin Hub
    • オープンソース
      • Kong Gateway
      • Kuma
      • Insomnia
      • Kongコミュニティ
    • 会社概要
      • Kongについて
      • お客様
      • キャリア
      • プレス
      • イベント
      • お問い合わせ
  • 利用規約• プライバシー• 信頼とコンプライアンス
© Kong Inc. 2025