4.7. 限定的なネットワーク環境でのリモートヘルスレポートの使用

Insights Operator アーカイブを手動で収集し、アップロードして限定的なネットワーク環境から問題を診断できます。

限定定期なネットワーク環境で Insights Operator を使用するには、以下を行う必要があります。

  • Insights Operator アーカイブのコピーを作成します。
  • Insights Operator アーカイブを console.redhat.com にアップロードします。

さらに、アップロード前に Insights Operator データを 難読化 することを選択できます。

4.7.1. Insights Operator の収集操作の実行

Insights Operator アーカイブを作成するには、収集操作を実行する必要があります。

前提条件

  • cluster-admin として OpenShift Container Platform にログインしている。

手順

  1. 以下のテンプレートを使用して、gather-job.yaml という名前のファイルを作成します。

    apiVersion: batch/v1
    kind: Job
    metadata:
      name: insights-operator-job
      annotations:
        config.openshift.io/inject-proxy: insights-operator
    spec:
      backoffLimit: 6
      ttlSecondsAfterFinished: 600
      template:
        spec:
          restartPolicy: OnFailure
          serviceAccountName: operator
          nodeSelector:
            beta.kubernetes.io/os: linux
            node-role.kubernetes.io/master: ""
          tolerations:
          - effect: NoSchedule
            key: node-role.kubernetes.io/master
            operator: Exists
          - effect: NoExecute
            key: node.kubernetes.io/unreachable
            operator: Exists
            tolerationSeconds: 900
          - effect: NoExecute
            key: node.kubernetes.io/not-ready
            operator: Exists
            tolerationSeconds: 900
          volumes:
          - name: snapshots
            emptyDir: {}
          - name: service-ca-bundle
            configMap:
              name: service-ca-bundle
              optional: true
          initContainers:
          - name: insights-operator
            image: quay.io/openshift/origin-insights-operator:latest
            terminationMessagePolicy: FallbackToLogsOnError
            volumeMounts:
            - name: snapshots
              mountPath: /var/lib/insights-operator
            - name: service-ca-bundle
              mountPath: /var/run/configmaps/service-ca-bundle
              readOnly: true
            ports:
            - containerPort: 8443
              name: https
            resources:
              requests:
                cpu: 10m
                memory: 70Mi
            args:
            - gather
            - -v=4
            - --config=/etc/insights-operator/server.yaml
          containers:
            - name: sleepy
              image: quay.io/openshift/origin-base:latest
              args:
                - /bin/sh
                - -c
                - sleep 10m
              volumeMounts: [{name: snapshots, mountPath: /var/lib/insights-operator}]
  2. insights-operator イメージバージョンをコピーします。

    $ oc get -n openshift-insights deployment insights-operator -o yaml
  3. gather-job.yaml でイメージのバージョンを貼り付けます。

    initContainers:
          - name: insights-operator
            image: <your_insights_operator_image_version>
            terminationMessagePolicy: FallbackToLogsOnError
            volumeMounts:
  4. 収集ジョブを作成します。

    $ oc apply -n openshift-insights -f gather-job.yaml
  5. ジョブ Pod の名前を見つけます。

    $ oc describe -n openshift-insights job/insights-operator-job

    出力例

    Events:
      Type    Reason            Age    From            Message
      ----    ------            ----   ----            -------
      Normal  SuccessfulCreate  7m18s  job-controller  Created pod: insights-operator-job-<your_job>

    insights-operator-job-<your_job> は Pod の名前です。

  6. 操作が完了したことを確認します。

    $ oc logs -n openshift-insights insights-operator-job-<your_job> insights-operator

    出力例

    I0407 11:55:38.192084       1 diskrecorder.go:34] Wrote 108 records to disk in 33ms

  7. 作成したアーカイブを保存します。

    $ oc cp openshift-insights/insights-operator-job-<your_job>:/var/lib/insights-operator ./insights-data
  8. ジョブをクリーンアップします。

    $ oc delete -n openshift-insights job insights-operator-job

4.7.2. Insights Operator アーカイブのアップロード

Insights Operator アーカイブを console.redhat.com に手動でアップロードし、潜在的な問題を診断できます。

前提条件

  • cluster-admin として OpenShift Container Platform にログインしている。
  • 制限なくインターネットアクセスができるワークステーションがある。
  • Insights Operator アーカイブのコピーを作成している。

手順

  1. dockerconfig.json ファイルをダウンロードします。

    $ oc extract secret/pull-secret -n openshift-config --to=.
  2. dockerconfig.json ファイルから" cloud.openshift.com" "auth " トークンをコピーします。

    {
      "auths": {
        "cloud.openshift.com": {
          "auth": "<your_token>",
          "email": "asd@redhat.com"
        }
    }
  3. console.redhat.com にアーカイブをアップロードします。

    $ curl -v -H "User-Agent: insights-operator/one10time200gather184a34f6a168926d93c330 cluster/<cluster_id>" -H "Authorization: Bearer <your_token>" -F "upload=@<path_to_archive>; type=application/vnd.redhat.openshift.periodic+tar" https://console.redhat.com/api/ingress/v1/upload

    ここで、<cluster_id> はクラスター ID、<your_token> はプルシークレットからのトークン、<path_to_archive> は Insights Operator アーカイブへのパスに置き換えます。

    操作に成功すると、コマンドは "request_id""account_number" を返します。

    出力例

    * Connection #0 to host console.redhat.com left intact
    {"request_id":"393a7cf1093e434ea8dd4ab3eb28884c","upload":{"account_number":"6274079"}}%

検証手順

  1. https://console.redhat.com/openshift にログインします。
  2. 左側のペインで Clusters メニューをクリックします。
  3. クラスターの詳細を表示するには、クラスターの名前をクリックします。
  4. クラスターの Insights Advisor タブを開きます。

    アップロードに成功すると、タブには以下のいずれかが表示されます。

    • Your cluster passed all recommendations: Insights でないも問題が特定されなかった場合。
    • Insights Advisor が検出した問題。リスク (低、中、重要および重大) 別に優先度が付けられます。

4.7.3. Insights Operator データの難読化の有効化

難読化を有効にして、機密性が高く、識別可能な IPv4 アドレスとクラスターベースドメインをマスクし、Insights Operator が console.redhat.com に送信できるようにします。

警告

この機能は利用可能ですが、Red Hat ではサポートサービスをより効果的に行えるように、難読化を無効のままにすることを推奨します。

難読化は、識別されていない値をクラスター IPv4 アドレスに割り当て、メモリーに保持される変換テーブルを使用して、データを console.redhat.com にアップロードする前に、Insights Operator アーカイブ全体で IP アドレスを難読化バージョンに変更します。

クラスターベースドメインでは、難読化により、ベースドメインがハードコードされたサブ文字列に変更されます。たとえば、cluster-api.openshift.example.comcluster-api.<CLUSTER_BASE_DOMAIN> になります。

以下の手順では、openshift-config namespace で support シークレットを使用して難読化を有効にします。

前提条件

  • OpenShift Container Platform Web コンソールに cluster-admin としてログインしている。

手順

  1. WorkloadsSecrets に移動します。
  2. openshift-config プロジェクトを選択します。
  3. Search by name フィールドを使用して support シークレットを検索します。存在しない場合には、CreateKey/value secret をクリックして作成します。
  4. Options メニュー kebab をクリックしてから Edit Secret をクリックします。
  5. Add Key/Value をクリックします。
  6. 値が trueenableGlobalObfuscation という名前のキーを作成し、Save をクリックします。
  7. WorkloadsPods に移動します。
  8. openshift-insights プロジェクトを選択します。
  9. insights-operator Pod を検索します。
  10. insights-operator Pod を再起動するには、Options メニュー kebab をクリックしてから Delete Pod をクリックします。

検証

  1. WorkloadsSecrets に移動します。
  2. openshift-insights プロジェクトを選択します。
  3. Search by name フィールドを使用して obfuscation-translation-table シークレットを検索します。

obfuscation-translation-table シークレットが存在する場合は、難読化が有効になって機能します。

または、Insights Operator アーカイブの /insights-operator/gathers.json"is_global_obfuscation_enabled": true の値を確認できます。

関連情報