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 권고 탭을 엽니다.

    업로드에 성공하면 탭에 다음 중 하나가 표시됩니다.

    • 클러스터에서 모든 권장 사항을 통과: Insights 권고에서 문제가 발견되지 않은 경우 표시됩니다.
    • Insights 권고에서 감지한 문제 목록으로 위험 (낮음, 중간, 중요 및 심각)에 따라 우선 순위가 지정됩니다.

4.7.3. Insights Operator 데이터 난독 처리

난독성을 활성화하여 Insights Operator가 console.redhat.com에 전송하는 중요하고 식별 가능한 IPv4 주소 및 클러스터 기본 도메인을 마스킹할 수 있습니다.

주의

이 기능을 사용할 수 있지만 Red Hat은 더욱 효과적인 지원 환경을 위해 난독 처리를 비활성할 것을 권장합니다.

난독 처리는 클러스터 IPv4 주소에 고유하지 않은 값을 할당하고, 메모리에 유지되는 변환 테이블을 사용하여 데이터를 console.redhat.com에 업로드하기 전에 Insights Operator 아카이브 전체의 난독 처리된 버전으로 IP 주소를 변경합니다.

클러스터 기본 도메인의 경우 난독 처리는 기본 도메인을 하드 코딩된 하위 문자열로 변경합니다. 예를 들어 cluster-api.openshift.example.comcluster-api.<CLUSTER_BASE_DOMAIN>이 됩니다.

다음 절차에서는 openshift-config 네임스페이스의 support 시크릿을 사용하여 난독화를 활성화합니다.

사전 요구 사항

  • cluster-admin으로 OpenShift Container Platform 웹 콘솔에 로그인되어 있습니다.

절차

  1. 워크로드시크릿으로 이동합니다.
  2. openshift-config 프로젝트를 선택합니다.
  3. 이름으로 검색 필드를 사용하여 지원 시크릿을 검색합니다. 존재하지 않는 경우 생성키/값 시크릿을 클릭하여 생성합니다.
  4. 옵션 메뉴를 kebab 클릭한 다음 시크릿 편집을 클릭합니다.
  5. 키/값 추가 클릭
  6. 값이 trueenableGlobalObfuscation이라는 키를 생성하고 저장을 클릭합니다.
  7. 워크로드Pod로 이동합니다.
  8. openshift-insights 프로젝트를 선택합니다.
  9. insights-operator pod를 찾습니다.
  10. insights-operator pod를 다시 시작하려면 옵션 메뉴 kebab 를 클릭한 다음 Pod 삭제를 클릭합니다.

검증

  1. 워크로드시크릿으로 이동합니다.
  2. openshift-insights 프로젝트를 선택합니다.
  3. 이름으로 검색 필드를 사용하여 난독화-translation-table 시크릿을 검색합니다.

obfuscation-translation-table 시크릿이 있으면 난독이 활성화되고 작동합니다.

또는 Insights Operator 아카이브의 /insights-operator/gathers.json 값을 "is_global_obfuscation_enabled": true로 검사할 수 있습니다.

추가 리소스