{"id":36584916,"url":"https://github.com/xendit/kompare","last_synced_at":"2026-01-12T08:02:16.057Z","repository":{"id":223238039,"uuid":"745011969","full_name":"xendit/kompare","owner":"xendit","description":"Kompare is a CLI tool to compare two kubernetes cluster and their resources.","archived":false,"fork":false,"pushed_at":"2025-10-01T03:45:07.000Z","size":113,"stargazers_count":61,"open_issues_count":0,"forks_count":2,"subscribers_count":21,"default_branch":"main","last_synced_at":"2025-10-01T05:39:25.362Z","etag":null,"topics":["cli","comparison","golang","kubernetes","resources"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xendit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-18T13:17:11.000Z","updated_at":"2025-10-01T03:43:19.000Z","dependencies_parsed_at":"2024-02-19T07:23:22.842Z","dependency_job_id":"d00bb776-effa-4491-a415-fe10f22dcbc4","html_url":"https://github.com/xendit/kompare","commit_stats":null,"previous_names":["xendit/kompare"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/xendit/kompare","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xendit%2Fkompare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xendit%2Fkompare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xendit%2Fkompare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xendit%2Fkompare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xendit","download_url":"https://codeload.github.com/xendit/kompare/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xendit%2Fkompare/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28336965,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","comparison","golang","kubernetes","resources"],"created_at":"2026-01-12T08:01:33.475Z","updated_at":"2026-01-12T08:02:16.047Z","avatar_url":"https://github.com/xendit.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kompare\n\nKompare is a Go CLI runner for comparing two clusters. This software compares two Kubernetes clusters using kubeconfig to connect to them and compare existing objects in the two clusters based on flexible criteria passed via the command line.\n\nWhen comparing two Kubernetes clusters, you may encounter challenges such as ignoring Kubernetes resource definition subtypes like UID and dates, or filtering and comparing only specific types of objects. Existing tools may not offer the flexibility to define such criteria, which led us to create Kompare.\n\n![Kompare: Simplifying Kubernetes Cluster Comparison](https://miro.medium.com/v2/resize:fit:1400/1*oOPoArcHhU26oM0iUuGjAA.png)\n\n## Why Do We Need Kompare\n\nThis CLI tool is designed to compare two clusters to determine if they are different or if they can be interchangeable. Enterprises often maintain multiple Kubernetes clusters for redundancy or to facilitate upgrades. We primarily use this tool to compare a production cluster (source cluster) with a new cluster intended for production use or to run side by side.\n\n**Notice:** The source cluster is typically considered the source of truth for the comparison.\n\n## Key Terms \u0026 Usage\n\n1. **Source cluster:** The original cluster, analogous to the \"left-hand side\" (LHS) in a number comparison.\n2. **Target cluster:** The destination cluster, analogous to the \"right-hand side\" (RHS) or the \"second number\" in a number comparison.\n\n## Getting Started\nYou can run it by building out directly with go if you have golang installed:\n```\n$ git clone https://github.com/xendit/kompare.git\n$ cd kompare\n$ go build -o kompare .\n$ ./kompare -h\nusage: print [-h|--help] [-c|--conf \"\u003cvalue\u003e\"] [-s|--src \"\u003cvalue\u003e\"] -t|--target\n             \"\u003cvalue\u003e\" [-v|--verbose] [-i|--include \"\u003cvalue\u003e\"] [-e|--exclude\n             \"\u003cvalue\u003e\"] [-n|--namespace \"\u003cvalue\u003e\"] [-f|--filter \"\u003cvalue\u003e\"]\n             [-l|--file \"\u003cvalue\u003e\"]\n\n             Prints provided string to stdout\n\nArguments:\n\n  -h  --help       Print help information\n  -c  --conf       Path to the clusters kubeconfig; assume ~/.kube/config if\n                   not provided\n  -s  --src        The Source cluster's context. Origin cluster in the\n                   comparison (LHS-left hand side)\n  -t  --target     *The target cluster's context (Required). Cluster used as\n                   destination or consequent (RHS - Right hand side)\n  -v  --verbose    -v lists the differences and -vv just shows all the diffs\n                   too.\n  -i  --include    List of kubernetes objects names to include, this should be\n                   an element or a comma separated list.\n  -e  --exclude    List of kubernetes objects to include, this should be an\n                   element or a comma separated list.\n  -n  --namespace  Namespace that needs to be copied. defaults to 'default'\n                   namespace. The option also accepts wilcard matching of\n                   namespace. E.G.: '*-pci' would match any namespace that ends\n                   with -pci. Notice that the '' might be required in some\n                   consoles like iterm\n  -f  --filter     Filter what parts of the object I want to compare. must be\n                   used together with -i option to apply to that type of\n                   objects\n  -l  --file       Save the output to a file. If not provided, the output will\n                   be printed to the console.\n$\n```\n\nTo run directly with golang if you have it installed:\n```\n$ git clone https://github.com/xendit/kompare.git\n$ cd kompare\n$ go run main.go -h\n(...)\n```\n\n### Using the software to compare two kubernetes clusters:\nNotice: The only option requires is -t.\n\nThis project is currently in development. To use it, either build it with Go or run it directly from the console:\n\n```\n./kompare -t some-target-context.\n```\nThe command with go would be `go run main.go -t some-target-context`.\n\nsee [this introductory post](https://blog.xendit.engineer/kompare-simplifying-kubernetes-cluster-comparison-ced2792716d9) for mode details. \n### Example Command\n\nTo compare the current context with \"MySecondContext-Cluster\", and view the differences using the `-v` (verbose see the help `-vv`) option, also in this case we are using `namespace kube-system` and we only want the `deployments`:\n\n```\n./kompare -t MySecondContext-Cluster  -v -n kube-system -i deploy\nWe will use current kubeconfig context as 'source cluster'.\nWe will use MySecondContext-Cluster kubeconfig context as 'target cluster'.\nUsing kube-system namespace\nLooping namespace: kube-system\nDeployment\n******************************************************************************************************\n- First cluster has Deployment in the list: blackbox-controller, but it's not in the second cluster\n\n******************************************************************************************************\n- Second cluster has Deployment in the list: aws-load-balancer-controller, but it's not in the first cluster\n\n******************************************************************************************************\nFinished Deployment for namespace: kube-system\nFinished all comparison works!\n```\n\nAnother example, we use velero for backups and want to see if both clusters have the same version deployed:\n```\n./kompare -t MySecondContext-Cluster -vv -n velero -i deploy\nWe will use current kubeconfig context as 'source cluster'.\nWe will use mycluster kubeconfig context as 'target cluster'.\nUsing velero namespace\nLooping namespace: velero\nDeployment\n******************************************************************************************************\nDone compering source cluster versus target cluster's  Deployment in the list\nDone compering target cluster versus source cluster's  Deployment in the list\nNo differences found; Object Name velero, Kubernetes resource definition type Name, Namespace velero\nKubernetes resource definition type: Spec.Template.Spec\nObject Name: velero\nNamespace: velero\nDifferences:\n- Containers.slice[0].Image: velero/velero:v1.12.2 != velero/velero:v1.9.2\n- Containers.slice[0].Args.slice[1]: --uploader-type=restic != \u003cno value\u003e\n- Containers.slice[0].LivenessProbe: v1.Probe != \u003cnil pointer\u003e\n- Containers.slice[0].ReadinessProbe: v1.Probe != \u003cnil pointer\u003e\n- TerminationGracePeriodSeconds: 3600 != 30\n\n\nFinished Deployment for namespace: velero\nFinished all comparison works!\n```\n\n**Notice:** The software assumes the current context as the source cluster by default (use `-s` or `--source` to set a different source context). The `-t` option specifies the destination/target cluster in your comparison. If it was number comparison -s is LHS and -t is RHS.\n\n**Notice:** The source cluster is typically considered the source of truth for the comparison in Kompare.\n## Prerequisites\n### for use\nFor now you need to build the binary.\n### Prerequisites for development\n\nKompare is written in Go and has been tested on Mac Silicon Processors. It should work on other architectures and operating systems as well. Ensure you have Go 1.21.6 or higher installed.\n\n## Contributing\n\nContributions such as pull requests, testing, and issue reporting are welcome. Current focus areas include:\n\n1. Adding more and better test cases.\n2. Improving visualization, particularly the summary view.\n3. Enhancing visualizations for differences in verbose mode.\n4. Addressing issues and bugs.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxendit%2Fkompare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxendit%2Fkompare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxendit%2Fkompare/lists"}