Mesh Doctorによるトラブルシューティング

Mesh Doctorは、サービス・メッシュ設定の問題をトラブルシューティングおよびデバッグするツールです。Mesh Doctorは、必要な構成とログを収集し、分析を実行し、レポートを生成します。レポートには、サービス・メッシュの状態が要約され、問題を修正するために必要なトラブルシューティング・ステップが示されます。

Mesh Doctorの使用

Mesh Doctorツールは2つの方法で使用できます。

  • OCI CLI: debugコマンドを使用してコマンドラインからMesh Doctorを実行します。
    ノート

    OCI CLIをインストールするには、OCI CLIのインストールを参照してください。
  • コンソール:次のステップを使用して、コンソールからMesh Doctorを実行できます。

    OCIコンソールは、OCIクラウド・シェル・ウィンドウでMesh Doctorコマンドを開き、コマンドを実行します。コマンドが完了すると、Mesh Doctorは生成されたレポートを含むzipファイルへのパスを提供します。レポートを表示するには、クラウド・シェルでファイルを解凍するか、圧縮したファイルをクラウド・シェルからダウンロードします。

重要

クラウド・シェルは、Mesh Doctorユーザー・インタフェースを強化します。このコマンドは、パブリッククラスタでのみ機能します。コマンドはプライベート・クラスタでタイムアウトします。

Mesh Doctorコマンドライン・オプション

次の表に、oci service-mesh debug baseコマンドに基づくすべてのMesh Doctorコマンド行オプションの詳細リストを示します。

パラメータ isOptional 値の型 デフォルト ノート
kubeconfig TRUE FilePath (文字列) ~/.kube/configに存在するkubeconfig ~/config Kubernetesクラスタの構成。configが指定されていない場合は、コマンドによってデフォルト構成が使用されます。
resource-id TRUE OCID Null ocid1.mesh.oc1.iad.id 診断するリソース。リソースが指定されていない場合、コマンドはインストールを診断します。
context TRUE 文字列 kube- configのcurrent- context コンテキストaaa Kubernetesクラスタのコンテキスト。
thread-pool-size TRUE 整数 25 10 処理のパラレル化に使用されるスレッド数。

Mesh Doctor CLIを使用した設定のトラブルシューティング

Kubernetesクラスタ内のサービス・メッシュ設定全体をトラブルシューティングするには、次のコマンドを実行します。

oci service-mesh debug report

Mesh Doctor CLIを使用したメッシュ・リソースのトラブルシューティング

次のMesh Doctor CLIコマンドは、ユースケースの例を示しています。

メッシュのトラブルシューティング:
oci service-mesh debug report --resource-id ocid1.mesh.oc1.iad.aaa...
コマンドを実行すると、次のように出力されます。
Bundle file path: /my-home/service-mesh-debug-report_07-01-2022_20-00-00
=============================== Mesh Report Analysis ===============================

OLM version: v0.20.0

|    Sidecar Image Versions    |
|    Version     |      Count     |
|    0.1.520     |       13       |
All sidecars are using same version

|  Config Versions   |
| Version   |   Count   |
|    5      |     13    |
All  configs are of the same version

All Operator Services are installed

All Mesh Webhooks are installed

All Mesh Custom Resources are installed
仮想サービスのトラブルシューティング:
oci service-mesh mesh-debug report --resource-id ocid1.meshvirtualservice.oc1.iad.aaa...
仮想デプロイメントのトラブルシューティング:
oci service-mesh mesh-debug report --resource-id ocid1.meshvirtualdeployment.oc1.iad.aaa...
イングレス・ゲートウェイのトラブルシューティング:
oci service-mesh mesh-debug report --resource-id ocid1.meshingressgateway.oc1.iad.aaa...
サンプル・メッシュ・レポート

メッシュ上で実行されるメッシュドクター レポートの例を次に示します。

report-mesh.json

{
    "metrics_server": [
        {
            "labels": {},
            "name": "Unavailable",
            "namespace": "Unavailable",
            "status": "Unavailable",
            "version": "Unavailable"
        }
    ],
    "oci_cli_version": [
        "X.X.X"
    ],
    "oci_service_operator_for_kubernetes": [
        {
            "labels": {
                "control-plane": "controller-manager",
                "pod-template-hash": "aaa"
            },
            "name": "oci-service-operator-controller-manager-aaa-tm52n",
            "namespace": "oci-service-operator-system",
            "status": {
                "conditions": [
                    {
                        "lastProbeTime": null,
                        "lastTransitionTime": "2022-04-13T00:06:20Z",
                        "status": "True",
                        "type": "Initialized"
                    },
                    {
                        "lastProbeTime": null,
                        "lastTransitionTime": "2022-04-13T00:06:30Z",
                        "status": "True",
                        "type": "Ready"
                    },
                    {
                        "lastProbeTime": null,
                        "lastTransitionTime": "2022-04-13T00:06:30Z",
                        "status": "True",
                        "type": "ContainersReady"
                    },
                    {
                        "lastProbeTime": null,
                        "lastTransitionTime": "2022-04-13T00:06:20Z",
                        "status": "True",
                        "type": "PodScheduled"
                    }
                ],
                "containerStatuses": [
                    {
                        "containerID": "cri-o://aaa...",
                        "image": "iad.ocir.io/aaa/oci-service-operator:1.0.X",
                        "imageID": "iad.ocir.io/aaa/oci-service-operator@sha256:aaa",
                        "lastState": {},
                        "name": "manager",
                        "ready": true,
                        "restartCount": 0,
                        "started": true,
                        "state": {
                            "running": {
                                "startedAt": "2022-04-13T00:06:24Z"
                            }
                        }
                    }
                ],
                "hostIP": "10.0.10.X",
                "phase": "Running",
                "podIP": "10.244.2.X",
                "podIPs": [
                    {
                        "ip": "10.244.2.X"
                    }
                ],
                "qosClass": "Burstable",
                "startTime": "2022-04-13T00:06:20Z"
            },
            "version": "1.0.X"
        }
    ],
    "olm": [
        {
            "labels": {
                "app": "olm-operator",
                "pod-template-hash": "aaa"
            },
            "name": "olm-operator-aaa-k42xw",
            "namespace": "olm",
            "status": {
                "running": {
                    "startedAt": "2022-04-13T00:05:37Z"
                }
            },
            "version": "v0.20.0"
        }
    ],
    "pod_summary": [
        {
            "labels": {
                "app": "productpage",
                "pod-template-hash": "aaa",
                "version": "v1"
            },
            "mesh_id": "ocid1.mesh.oc1.iad.aaa...",
            "name": "productpage-v1-aaa-f5ptd",
            "namespace": "my-namespace",
            "proxy_status": {
                "running": {
                    "startedAt": "2022-04-13T05:37:57Z"
                }
            },
            "proxy_version": "0.1.X",
            "vd_id": "ocid1.mesh.oc1.iad.aaa...",
            "vdb_key": "my-namespace/productpage-v1-binding",
            "vs_id": "ocid1.meshvirtualservice.oc1.iad.aaa..."
        },
        {
            "labels": {
                "app": "reviews",
                "pod-template-hash": "aaa",
                "version": "v3"
            },
            "mesh_id": "ocid1.mesh.oc1.iad.aaa...",
            "name": "reviews-v3-aaa-q9z6k",
            "namespace": "my-namespace",
            "proxy_status": {
                "running": {
                    "startedAt": "2022-04-13T05:37:46Z"
                }
            },
            "proxy_version": "0.1.X",
            "vd_id": "ocid1.mesh.oc1.iad.aaa...",
            "vdb_key": "my-namespace/reviews-v3-binding",
            "vs_id": "ocid1.meshvirtualservice.oc1.iad.aaa..."
        },
        {
            "labels": {
                "app": "reviews",
                "pod-template-hash": "bbb",
                "version": "v2"
            },
            "mesh_id": "ocid1.mesh.oc1.iad.aaa...",
            "name": "reviews-v2-bbb-9rdpw",
            "namespace": "my-namespace",
            "proxy_status": {
                "running": {
                    "startedAt": "2022-04-13T05:37:40Z"
                }
            },
            "proxy_version": "0.1.X",
            "vd_id": "ocid1.mesh.oc1.iad.aaa...",
            "vdb_key": "my-namespace/reviews-v2-binding",
            "vs_id": "ocid1.meshvirtualservice.oc1.iad.aaa..."
        },
        {
            "labels": {
                "app": "reviews",
                "pod-template-hash": "ddd",
                "version": "v1"
            },
            "mesh_id": "ocid1.mesh.oc1.iad.aaa...",
            "name": "reviews-v1-ddd-kq6qr",
            "namespace": "my-namespace",
            "proxy_status": {
                "running": {
                    "startedAt": "2022-04-13T05:37:27Z"
                }
            },
            "proxy_version": "0.1.X",
            "vd_id": "ocid1.mesh.oc1.iad.aaa...",
            "vdb_key": "my-namespace/reviews-v1-binding",
            "vs_id": "ocid1.meshvirtualservice.oc1.iad.aaa..."
        },
        {
            "ig_id": "ocid1.meshingressgateway.oc1.iad.aaa...",
            "igd_key": "my-namespace/bookinfo-ig-deployment",
            "labels": {
                "pod-template-hash": "eee",
                "servicemesh.oci.oracle.com/ingress-gateway-deployment": "bookinfo-ig-deployment"
            },
            "mesh_id": "ocid1.mesh.oc1.iad.aaa...",
            "name": "bookinfo-ig-deployment-deployment-eee-dj9b5",
            "namespace": "my-namespace",
            "proxy_status": {
                "running": {
                    "startedAt": "2022-04-13T00:12:15Z"
                }
            },
            "proxy_version": "0.1.X"
        },
        {
            "labels": {
                "app": "ratings",
                "pod-template-hash": "fff",
                "version": "v1"
            },
            "mesh_id": "ocid1.mesh.oc1.iad.aaa...",
            "name": "ratings-v1-fff-67txf",
            "namespace": "my-namespace",
            "proxy_status": {
                "running": {
                    "startedAt": "2022-04-13T05:35:36Z"
                }
            },
            "proxy_version": "0.1.X",
            "vd_id": "ocid1.mesh.oc1.iad.aaa...",
            "vdb_key": "my-namespace/ratings-v1-binding",
            "vs_id": "ocid1.meshvirtualservice.oc1.iad.aaa..."
        },
        {
            "labels": {
                "app": "details",
                "pod-template-hash": "aaa",
                "version": "v1"
            },
            "mesh_id": "ocid1.mesh.oc1.iad.aaa...",
            "name": "details-v1-aaa-xsmkq",
            "namespace": "my-namespace",
            "proxy_status": {
                "running": {
                    "startedAt": "2022-04-13T05:38:03Z"
                }
            },
            "proxy_version": "0.1.X",
            "vd_id": "ocid1.mesh.oc1.iad.aaa...",
            "vdb_key": "my-namespace/details-v1-binding",
            "vs_id": "ocid1.meshvirtualservice.oc1.iad.aaa..."
        }
    ],
    "sidecar_injection_enabled_namespaces": [
        [
            "host-mesh-cp-aaa",
            "my-namespace"
        ]
    ]
}
必要なKubernetes認可

Mesh Doctorは、ユーザーの既存のKubernetes認可を使用して、ユーザーのかわりにkubectlコマンドを実行します。必要な権限が存在しない場合、コマンドはデータの収集に失敗します。

必要なすべてのデータを収集するには、ユーザーには次のアクセス権限が必要です。

  • listgetexec - サービス・メッシュのポッド用。
  • listget - すべてのメッシュ・リソース(CRD)用。
  • listgetexec - OLMネームスペースのポッド用。
  • list - サービスの権限。

Kubernetesのロールベースのアクセス制御の詳細は、RBAC認可の使用を参照してください

Mesh Doctorレポート構造

Mesh Doctorを実行すると、レポート階層に戻されるデータがツールによって構造化されます。特定のリソースでMesh Doctorを実行すると、レポートにはそのリソースおよび子データのデータのみが含まれます。Mesh Doctorは、次のレポート構造を使用します。

メッシュ <directory>

  • メッシュ・レポート
  • OCI Kubernetesログ・サービス・オペレータ
  • クラスタ・サービス・バージョンのダンプ
  • メッシュが存在する場合の顧客リソース定義(CRD)
  • イングレス・ゲートウェイ<directory>
    • 受信ゲートウェイ・レポート
    • イングレス・ゲートウェイのCRD (存在する場合)
    • イングレス・ゲートウェイ・デプロイメント
      • イングレス・ゲートウェイ・デプロイメントのCRD
      • configdump_<podName>_<podNamespace>.json
      • proxylogs_<podName>_<podNamespace>.log
  • 仮想サービス <directory>
    • 仮想サービス・レポート
    • 仮想サービスのCRD (存在する場合)
    • 仮想デプロイメント<directory>
      • 仮想デプロイメント・レポート
      • 仮想デプロイメントのCRD (存在する場合)
      • 仮想デプロイメント・バインディング<directory>
        • 仮想デプロイメント・バインディングのCRD
        • configdump_<podName>_<podNamespace>.json
        • >proxylogs_<podName>_<podNamespace>.log