サービス メッシュについてAbout service meshes
この記事の内容
サービス メッシュは、ワークロードに対するトラフィック管理、回復性、ポリシー、セキュリティ、強力な ID、可観測性などの機能を提供します。A service mesh provides capabilities like traffic management, resiliency, policy, security, strong identity, and observability to your workloads. アプリケーションはこれらの運用上の機能から切り離され、サービス メッシュがそれらをアプリケーション レイヤーからインフラストラクチャ レイヤーに移動します。Your application is decoupled from these operational capabilities and the service mesh moves them out of the application layer, and down to the infrastructure layer.
シナリオScenarios
次に示すのは、サービス メッシュを使用しているときにワークロードに対して有効にできるシナリオの一部です。These are some of the scenarios that can be enabled for your workloads when you use a service mesh:
クラスター内のすべてのトラフィックの暗号化 - クラスター内の指定されたサービス間で相互 TLS を有効にします。 - Enable mutual TLS between specified services in the cluster. これは、ネットワーク境界でのイングレスとエグレスに拡張できます。This can be extended to ingress and egress at the network perimeter. アプリケーション コードとインフラストラクチャの変更を必要とせずに、既定でのセキュリティ保護オプションを提供します。Provides a secure by default option with no changes needed for application code and infrastructure.
カナリアおよびフェーズ ロールアウト - クラスター内の一連の新しいサービスにルーティングされるトラフィックのサブセットの条件を指定します。 - Specify conditions for a subset of traffic to be routed to a set of new services in the cluster. カナリア リリースのテストが成功したら、条件付きルーティングを削除し、新しいサービスへのすべてのトラフィックの割合を徐々に増やします。On successful test of canary release, remove conditional routing and phase gradually increasing % of all traffic to new service. 最終的には、すべてのトラフィックが新しいサービスに送信されます。Eventually all traffic will be directed to new service.
トラフィック管理と操作 - 特定の配信元からのサービスのすべてのトラフィックをレート制限するポリシーをサービスに対して作成します。 - Create a policy on a service that will rate limit all traffic to a version of a service from a specific origin. つまり、指定されたサービス間の障害のクラスに再試行戦略を適用するポリシーです。Or a policy that applies a retry strategy to classes of failures between specified services. 移行中または問題をデバッグするために、新しいバージョンのサービスにライブ トラフィックをミラーリングします。Mirror live traffic to new versions of services during a migration or to debug issues. テスト環境のサービス間にフォールトを挿入して、回復性をテストします。Inject faults between services in a test environment to test resiliency.
可観測性 - サービス間のトラフィックがどのように接続されているかについての分析情報を得ることができます。 - Gain insight into how your services are connected the traffic that flows between them. クラスター内のすべてのトラフィックのメトリック、ログ、およびトレースと、イングレス/エグレスを取得します。Obtain metrics, logs, and traces for all traffic in cluster, and ingress/egress. アプリケーションに分散トレース機能を追加します。Add distributed tracing abilities to your applications.
アーキテクチャArchitecture
サービス メッシュは、通常、コントロール プレーンとデータ プレーンで構成されます。A service mesh is typically composed of a control plane and the data plane.
コントロール プレーンには、サービス メッシュの管理をサポートするさまざまなコンポーネントがあります。The has a number of components that support managing the service mesh. これには通常、UI や API などの管理インターフェイスが含まれます。This will typically include a management interface which could be a UI or an API. また、通常は、ルールを管理するコンポーネントと、サービス メッシュが特定の機能を実装する方法を定義するポリシー定義もあります。There will also typically be components that manage the rule and policy definitions that define how the service mesh should implement specific capabilities. さらに、mTLS の強力な ID や証明書などのセキュリティの側面を管理するコンポーネントもあります。There are also components that manage aspects of security like strong identity and certificates for mTLS. サービス メッシュには、ワークロードからメトリックとテレメトリを収集して集計する、メトリックまたは可観測性コンポーネントも含まれます。Service meshes will also typically have a metrics or observability component that collects and aggregates metrics and telemetry from the workloads.
データ プレーンは、通常、ワークロードにサイドカーとして透過的に挿入されるプロキシで構成されます。The typically consists of a proxy that is transparently injected as a sidecar to your workloads. このプロキシは、ワークロードを含むポッドとの間のすべてのネットワーク トラフィックを制御するように構成されています。This proxy is configured to control all network traffic in and out of the pod containing your workload. これにより、プロキシは、mTLS 経由でトラフィックをセキュリティで保護し、トラフィックを動的にルーティングし、トラフィックにポリシーを適用し、メトリックとトレース情報を収集するように構成することができます。This allows the proxy to be configured to secure traffic via mTLS, dynamically route traffic, apply policies to traffic and to collect metrics and tracing information.
機能Capabilities
各サービス メッシュは自然に適合し、特定のシナリオをサポートすることに重点を置いていますが、通常は、ほとんどの場合、すべてではないにしても多くの次の機能を実装します。Each of the service meshes have a natural fit and focus on supporting specific scenarios, but you'll typically find that most will implement a number of, if not all, of the following capabilities.
トラフィック管理Traffic management
- プロトコル – レイヤー 7 (http、grpc) – layer 7 (http, grpc)
- 動的ルーティング – 条件、重み付け、ミラーリング – conditional, weighting, mirroring
- 回復性 – タイムアウト、再試行、サーキット ブレーカー – timeouts, retries, circuit breakers
- ポリシー – アクセス制御、レート制限、クォータ – access control, rate limits, quotas
- テスト – フォールト挿入 - fault injection
セキュリティSecurity
- 暗号化 – mTLS、証明書管理、外部 CA – mTLS, certificate management, external CA
- 強力な ID – SPIFFE または類似 – SPIFFE or similar
- 認証 – 認証、承認 – authentication, authorisation
可観測性Observability
- メトリック – ゴールデン メトリック、prometheus、grafana – golden metrics, prometheus, grafana
- トレース – ワークロード間のトレース - traces across workloads
- トラフィック – クラスター、イングレス/エグレス – cluster, ingress/egress
メッシュMesh
- サポートされているコンピューティング – Kubernetes、仮想マシン - Kubernetes, virtual machines
- マルチクラスター – ゲートウェイ、フェデレーション - gateways, federation
選択条件Selection criteria
サービス メッシュを選択する前に、要件とサービス メッシュをインストールする理由を理解していることを確認してください。Before you select a service mesh, ensure that you understand your requirements and the reasons for installing a service mesh. 次の質問をしてみてください。Try asking the following questions.
イングレス コントローラーはニーズに十分対応しているか。 - 必要なシナリオに対応するには、a/b テストやイングレスでのトラフィックの分割などの機能が必要な場合があります。- Sometimes having a capability like a/b testing or traffic splitting at the ingress is sufficient to support the required scenario. 環境に利点のない複雑さを加えないでください。Don't add complexity to your environment with no upside.
ワークロードと環境は追加のオーバーヘッドを許容するか。 - サービス メッシュをサポートするために必要な追加のコンポーネントはすべて、CPU やメモリなどの追加のリソースを必要とします。- All the additional components required to support the service mesh require additional resources like cpu and memory. さらに、すべてのプロキシとそれに関連付けられているポリシー チェックにより、トラフィックに待機時間が追加されます。In addition, all the proxies and their associated policy checks add latency to your traffic. 待機時間が非常に重要なワークロードがある場合、またはサービス メッシュ コンポーネントに対応するための追加リソースを提供できない場合は、もう一度検討してください。If you have workloads that are very sensitive to latency or cannot provide the additional resources to cover the service mesh components, then re-consider.
これは不必要に複雑さを加えるものか。 - サービス メッシュをインストールする理由が、ビジネス チームや運用チームにとって必ずしも重要ではない機能を利用することである場合は、インストール、メンテナンス、および構成の複雑さが増すかどうかを検討してください。- If the reason for installing a service mesh is to gain a capability that is not necessarily critical to the business or operational teams, then consider whether the additional complexity of installation, maintenance, and configuration is worth it.
これは漸進的アプローチで採用できるか。 - 多くの機能を提供するサービス メッシュの中には、より漸進的なアプローチを採用するものがあります。- Some of the service meshes that provide a lot of capabilities can be adopted in a more incremental approach. 確実に成功するためには、必要なコンポーネントだけをインストールしてください。Install just the components you need to ensure your success. 自信を持って追加の機能が必要になったら、それらを調査してください。Once you are more confident and additional capabilities are required, then explore those. 最初からすべてのものをインストールするという衝動は抑えてください。Resist the urge to install from the start.
慎重に検討したうえで、必要な機能を提供するためにサービス メッシュが必要であると判断した場合、次に決定することはどのサービス メッシュかということです。If, after careful consideration, you decide that you need a service mesh to provide the capabilities required, then your next decision is
次の点を考慮して、要件に最も合うものを検討してください。Consider the following areas and which of them are most aligned with your requirements. これにより、ご使用の環境とワークロードに最適な方法を見つけることができます。This will guide you towards the best fit for your environment and workloads. 「次のステップ」のセクションでは、特定のサービス メッシュに関する詳細情報と、これらの機能をこれらの領域にマップする方法について説明します。The section will take you to further detailed information about specific service meshes and how they map to these areas.
技術 - トラフィック管理、ポリシー、セキュリティ、可観測性 - traffic management, policy, security, observability
ビジネス - 法人向けサポート、基盤 (CNCF)、OSS ライセンス、ガバナンス - commercial support, foundation (CNCF), OSS license, governance
運用 - インストール/アップグレード、リソース要件、パフォーマンス要件、統合 (メトリック、テレメトリ、ダッシュボード、ツール、SMI)、混合ワークロード (Linux と Windows のノード プール)、コンピューティング (Kubernetes、仮想マシン)、マルチクラスター – installation/upgrades, resource requirements, performance requirements, integrations (metrics, telemetry, dashboards, tools, SMI), mixed workloads (Linux and Windows node pools), compute (Kubernetes, virtual machines), multi-cluster
セキュリティ - 認証、ID、証明書の管理とローテーション、プラグ可能な外部 CA - auth, identity, certificate management and rotation, pluggable external CA
次の手順Next steps
次のドキュメントでは、Azure Kubernetes Service (AKS) で試すことができるサービス メッシュの詳細について説明しています。The following documentation provides more information about service meshes that you can try out on Azure Kubernetes Service (AKS):
Kubernetes のサービス メッシュの標準インターフェイスである Service Mesh Interface (SMI) について確認することもできます。You may also want to explore Service Mesh Interface (SMI), a standard interface for service meshes on Kubernetes:
