1.3. サブスクリプションレポート


サブスクリプションレポートは、フリート内のすべてのマネージドクラスターからのアプリケーションステータスのコレクションです。具体的には、親アプリケーションリソースは、スケーラブルなマネージドクラスターからのレポートを保持できます。

詳細なアプリケーションステータスはマネージドクラスターで利用できますが、ハブクラスターの subscriptionReports は軽量でスケーラブルです。以下の 3 種類のサブ状態レポートを参照してください。

1.3.1. SubscriptionStatus パッケージレベル

パッケージレベルのマネージドクラスターのステータスは、マネージドクラスターの <namespace:<your-appsub-namespace> にあり、アプリケーションでデプロイされたすべてのリソースの詳細ステータスが含まれます。マネージドクラスターにデプロイされるすべての appsub に対して、マネージドクラスターの appsub namespace に SubscriptionStatus CR が作成されます。エラーが存在する場合は、すべてのリソースが詳細エラーと共に報告されます。

以下の SubscriptionStatus サンプル YAML ファイルを参照してください。

apiVersion: apps.open-cluster-management.io/v1alpha1
kind: SubscriptionStatus
metadata:
  labels:
    apps.open-cluster-management.io/cluster: <your-managed-cluster>
    apps.open-cluster-management.io/hosting-subscription: <your-appsub-namespace>.<your-appsub-name>
  name: <your-appsub-name>
  namespace: <your-appsub-namespace>
statuses:
  packages:
  - apiVersion: v1
    kind: Service
    lastUpdateTime: "2021-09-13T20:12:34Z"
    Message: <detailed error. visible only if the package fails>
    name: frontend
    namespace: test-ns-2
    phase: Deployed
  - apiVersion: apps/v1
    kind: Deployment
    lastUpdateTime: "2021-09-13T20:12:34Z"
    name: frontend
    namespace: test-ns-2
    phase: Deployed
  - apiVersion: v1
    kind: Service
    lastUpdateTime: "2021-09-13T20:12:34Z"
    name: redis-master
    namespace: test-ns-2
    phase: Deployed
  - apiVersion: apps/v1
    kind: Deployment
    lastUpdateTime: "2021-09-13T20:12:34Z"
    name: redis-master
    namespace: test-ns-2
    phase: Deployed
  - apiVersion: v1
    kind: Service
    lastUpdateTime: "2021-09-13T20:12:34Z"
    name: redis-slave
    namespace: test-ns-2
    phase: Deployed
  - apiVersion: apps/v1
    kind: Deployment
    lastUpdateTime: "2021-09-13T20:12:34Z"
    name: redis-slave
    namespace: test-ns-2
    phase: Deployed

1.3.2. SubscriptionReport クラスターレベル

クラスターレベルのステータスはハブクラスターの <namespace:<your-managed-cluster-1> にあり、そのマネージドクラスターの各アプリケーションの全体的なステータスのみが含まれます。ハブクラスターの各クラスター namespace の subscriptionReport は、以下のステータスのいずれかを報告します。

  • Deployed
  • Failed
  • propagationFailed

以下の SubscriptionReport のサンプル YAML ファイルを参照してください。

apiVersion: apps.open-cluster-management.io/v1alpha1
kind: subscriptionReport
metadata:
  labels:
    apps.open-cluster-management.io/cluster: "true"
  name: <your-managed-cluster-1>
  namespace: <your-managed-cluster-1>
reportType: Cluster
results:
- result: deployed
  source: appsub-1-ns/appsub-1                     // appsub 1 to <your-managed-cluster-1>
  timestamp:
    nanos: 0
    seconds: 1634137362
- result: failed
  source: appsub-2-ns/appsub-2                     // appsub 2 to <your-managed-cluster-1>
  timestamp:
    nanos: 0
    seconds: 1634137362
- result: propagationFailed
  source: appsub-3-ns/appsub-3                     // appsub 3 to <your-managed-cluster-1>
  timestamp:
    nanos: 0
    seconds: 1634137362

1.3.3. SubscriptionReport アプリケーションレベル

各アプリケーションのアプリケーションレベルの 1 つである subscriptionReport が、ハブクラスターの appsub namespace の <namespace:<your-appsub-namespace> にあり、以下の情報が含まれています。

  • 各マネージドクラスターのアプリケーション全体のステータス
  • アプリケーションのすべてのリソースのリスト
  • クラスターの合計数を含むレポートサマリー
  • アプリケーションがステータスにあるクラスターの合計数 (deployedfailedpropagationFailed、および inProgress) のレポートサマリー。

注記: inProcess ステータスは、合計マイナス deployed、さらに failed `, と `propagationFailed をマイナスします。

以下の SubscriptionReport のサンプル YAML ファイルを参照してください。

apiVersion: apps.open-cluster-management.io/v1alpha1
kind: subscriptionReport
metadata:
  labels:
    apps.open-cluster-management.io/hosting-subscription: <your-appsub-namespace>.<your-appsub-name>
  name: <your-appsub-name>
  namespace: <your-appsub-namespace>
reportType: Application
resources:
- apiVersion: v1
  kind: Service
  name: redis-master2
  namespace: playback-ns-2
- apiVersion: apps/v1
  kind: Deployment
  name: redis-master2
  namespace: playback-ns-2
- apiVersion: v1
  kind: Service
  name: redis-slave2
  namespace: playback-ns-2
- apiVersion: apps/v1
  kind: Deployment
  name: redis-slave2
  namespace: playback-ns-2
- apiVersion: v1
  kind: Service
  name: frontend2
  namespace: playback-ns-2
- apiVersion: apps/v1
  kind: Deployment
  name: frontend2
  namespace: playback-ns-2
results:
- result: deployed
  source: cluster-1                            //cluster 1 status
  timestamp:
    nanos: 0
    seconds: 0
- result: failed
  source: cluster-3                            //cluster 2 status
  timestamp:
    nanos: 0
    seconds: 0
- result: propagationFailed
  source: cluster-4                            //cluster 3 status
  timestamp:
    nanos: 0
    seconds: 0
summary:
  deployed: 8
  failed: 1
  inProgress: 0
  propagationFailed: 1
  clusters: 10

1.3.4. ManagedClusterView

ManagedClusterView CR は、最初の failed クラスターについて報告されます。リソースのデプロイに失敗した複数のクラスターにアプリケーションがデプロイされた場合、ハブクラスターで最初に失敗したクラスター namespace に対して managedClusterViewCR 1 つだけが作成されます。managedClusterView CR は、障害が発生したクラスターから詳細なサブスクリプションステータスを取得するため、アプリケーションの所有者は障害が発生したリモートクラスターにアクセスする必要がありません。

以下のコマンドを実行してステータスを取得できます。

% oc get managedclusterview -n <failing-clusternamespace> "<app-name>-<app name>"

1.3.5. CLI アプリケーションレベルのステータス

マネージドクラスターにアクセスしてサブスクリプションステータスを取得できない場合は、CLI を使用できます。クラスターレベルまたはアプリケーションレベルのサブスクリプションレポートは、全体のステータスは含まれますが、アプリケーションの詳細なエラーメッセージは含まれません。

  1. multicloud-operators-subscription から CLI をダウンロードします。
  2. 以下のコマンドを実行して managedClusterView リソースを作成し、エラーを特定できるようにマネージドクラスターアプリケーションの SubscriptionStatus を表示します。
% getAppSubStatus.sh -c <your-managed-cluster> -s <your-appsub-namespace> -n <your-appsub-name>

1.3.6. CLI 最終更新時間

また、各マネージドクラスターにログインしてこの情報を取得する場合は、指定のマネージドクラスターでの AppSub の最終更新時間を取得することもできます。そのため、マネージドクラスターの AppSub の最終更新時間の取得を簡素化するために、ユーティリティースクリプトが作成されました。このスクリプトは、ハブクラスターで実行するように設計されています。これは、マネージドクラスターから AppSub を取得するための managedClusterView リソースを作成し、データを解析して最終更新時刻を取得します。

  1. multicloud-operators-subscription から CLI をダウンロードします。
  2. 以下のコマンドを実行して、マネージドクラスターの AppSub最終更新時間 を取得します。このスクリプトは、ハブクラスターで実行するように設計されています。managedClusterView リソースを作成してマネージドクラスターから AppSub を取得し、データを解析して最終更新時間を取得します。
% getLastUpdateTime.sh -c <your-managed-cluster> -s <your-appsub-namespace> -n <your-appsub-name>
Red Hat logoGithubRedditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

© 2024 Red Hat, Inc.