6.3. Using the cluster-compare plugin


You can use the cluster-compare plugin to compare a reference configuration with a configuration from a live cluster or must-gather data.

6.3.1. Using the cluster-compare plugin with a live cluster

You can use the cluster-compare plugin to compare a reference configuration with configuration custom resources (CRs) from a live cluster.

Validate live cluster configurations to ensure compliance with reference configurations during design, development, or testing scenarios.

참고

Use the cluster-compare plugin with live clusters in non-production environments only. For production environments, use the plugin with must-gather data.

Prerequisites

  • You installed the OpenShift CLI (oc).
  • You have access to the cluster as a user with the cluster-admin role.
  • You downloaded the cluster-compare plugin and include it in your PATH environment variable.
  • You have access to a reference configuration.

Procedure

  • Run the cluster-compare plugin by using the following command:

    $ oc cluster-compare -r <path_to_reference_config>/metadata.yaml
    • -r specifies a path to the metadata.yaml file of the reference configuration. You can specify a local directory or a URI.

      Example output

      ...
      
      **********************************
      
      Cluster CR: operator.openshift.io/v1_Console_cluster 
      1
      
      Reference File: optional/console-disable/ConsoleOperatorDisable.yaml 
      2
      
      Diff Output: diff -u -N /tmp/MERGED-622469311/operator-openshift-io-v1_console_cluster /tmp/LIVE-2358803347/operator-openshift-io-v1_console_cluster
      /tmp/MERGED-622469311/operator-openshift-io-v1_console_cluster	2024-11-20 15:43:42.888633602 +0000
      +++ /tmp/LIVE-2358803347/operator-openshift-io-v1_console_cluster	2024-11-20 15:43:42.888633602 +0000
      @@ -4,5 +4,5 @@
         name: cluster
       spec:
         logLevel: Normal
      -  managementState: Removed 
      3
      
      +  managementState: Managed
         operatorLogLevel: Normal
      
      **********************************
      
      …
      
      Summary 
      4
      
      CRs with diffs: 5/49 
      5
      
      CRs in reference missing from the cluster: 1 
      6
      
      required-cluster-tuning:
        cluster-tuning:
          Missing CRs: 
      7
      
          - required/cluster-tuning/disabling-network-diagnostics/DisableSnoNetworkDiag.yaml
      No CRs are unmatched to reference CRs 
      8
      
      Metadata Hash: 512a9bf2e57fd5a5c44bbdea7abb3ffd7739d4a1f14ef9021f6793d5cdf868f0 
      9
      
      No patched CRs 
      10

      1
      The CR under comparison. The plugin displays each CR with a difference from the corresponding template.
      2
      The template matching with the CR for comparison.
      3
      The output in Linux diff format shows the difference between the template and the cluster CR.
      4
      After the plugin reports the line diffs for each CR, the summary of differences are reported.
      5
      The number of CRs in the comparison with differences from the corresponding templates.
      6
      The number of CRs represented in the reference configuration, but missing from the live cluster.
      7
      The list of CRs represented in the reference configuration, but missing from the live cluster.
      8
      The CRs that did not match to a corresponding template in the reference configuration.
      9
      The metadata hash identifies the reference configuration.
      10
      The list of patched CRs.
참고

Get the output in the junit format by adding -o junit to the command. For example:

$ oc cluster-compare -r <path_to_reference_config>/metadata.yaml -o junit

The junit output includes the following result types:

  • Passed results for each fully matched template.
  • Failed results for differences found or missing required custom resources (CRs).
  • Skipped results for differences patched using the user override mechanism.
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 문서 정보

Legal Notice

Theme

© 2026 Red Hat
맨 위로 이동