https://github.com/borball/ocp-cluster-diff
Script to compare 2 OpenShift clusters
https://github.com/borball/ocp-cluster-diff
Last synced: 5 months ago
JSON representation
Script to compare 2 OpenShift clusters
- Host: GitHub
- URL: https://github.com/borball/ocp-cluster-diff
- Owner: borball
- Created: 2024-08-01T15:15:16.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2025-04-17T12:19:41.000Z (about 1 year ago)
- Last Synced: 2025-04-18T02:50:12.136Z (about 1 year ago)
- Language: Shell
- Homepage:
- Size: 715 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Usage
### Generate must-gather
Note that the default must-gather image may not collect all the resources required for the comparison, so a custom
image can/shall be used in this repo.
Update the [resources.cfg](collection-scripts/resources.cfg) based on your needs to if you need to compare additional resources. Build the
image and publish it to your registry so that you can fetch the cluster data accordingly.
In this repo, we built and published the image to quay.io/bzhai/caas-vdu-must-gather:4.18
To generate a custom must-gather, run command below towards the clusters you want to compare:
```shell
# cluster 1
oc adm must-gather --image=quay.io/bzhai/vdu-caas-must-gather:4.18 --dest-dir cluster1-must-gather
# cluster 2
oc adm must-gather --image=quay.io/bzhai/vdu-caas-must-gather:4.18 --dest-dir cluster2-must-gather
```
### Compare
Then compare the collected resources:
```shell
diff.sh cluster1-must-gather cluster2-must-gather
```
### Demo

### Extend
You can update the file [resources.cfg](collection-scripts/resources.cfg) to add/remove resoures:
```shell
cluster_scoped_resources=(
"clusterversion/version"
"containerruntimeconfigs"
"performanceprofiles"
"networks.operator.openshift.io/cluster"
"mc/container-mount-namespace-and-kubelet-conf-master"
"mc/06-kdump-enable-master"
"mc/07-sriov-related-kernel-args-master"
"mc/08-set-rcu-normal-master"
"mc/99-crio-disable-wipe-master"
"mc/99-sync-time-once-master"
)
namespaced_resources=(
"openshift-cluster-node-tuning-operator tuned"
"openshift-monitoring cm/cluster-monitoring-config"
"openshift-operator-lifecycle-manager cm/collect-profiles-config"
"openshift-marketplace catalogsource/redhat-operators"
"openshift-marketplace catalogsource/certified-operators"
"openshift-ptp ptpconfig"
"openshift-ptp ptpoperatorconfig"
"openshift-sriov-network-operator SriovOperatorConfig"
"openshift-sriov-network-operator SriovNetwork"
"openshift-sriov-network-operator SriovNetworkNodePolicy"
"openshift-local-storage LocalVolumeSet"
)
```
then modify .env so that you can build and publish the image to your own registry:
```
DOCKER_IMAGE=/vdu-caas-must-gather
DOCKER_TAG=4.18
```
```shell
make podman_build podman_publish
```