{"id":13452331,"url":"https://github.com/weaveworks/kubediff","last_synced_at":"2025-09-28T19:31:25.312Z","repository":{"id":9705601,"uuid":"62892441","full_name":"weaveworks/kubediff","owner":"weaveworks","description":"Kubediff: a tool for Kubernetes to show differences between running state and version controlled configuration.","archived":true,"fork":false,"pushed_at":"2023-10-24T15:14:24.000Z","size":2401,"stargazers_count":1178,"open_issues_count":31,"forks_count":102,"subscribers_count":57,"default_branch":"main","last_synced_at":"2024-04-14T23:02:12.865Z","etag":null,"topics":["gitops","kubernetes","observability","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/weaveworks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2016-07-08T13:56:37.000Z","updated_at":"2024-03-16T17:32:41.000Z","dependencies_parsed_at":"2023-01-11T20:13:06.578Z","dependency_job_id":"c6935c5f-1ac7-4be1-b219-23a826a1bc61","html_url":"https://github.com/weaveworks/kubediff","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaveworks%2Fkubediff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaveworks%2Fkubediff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaveworks%2Fkubediff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaveworks%2Fkubediff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weaveworks","download_url":"https://codeload.github.com/weaveworks/kubediff/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234555781,"owners_count":18851845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["gitops","kubernetes","observability","python"],"created_at":"2024-07-31T07:01:20.826Z","updated_at":"2025-09-28T19:31:24.625Z","avatar_url":"https://github.com/weaveworks.png","language":"Python","funding_links":[],"categories":["Configuration","Python","Tools and Libraries","python"],"sub_categories":["[Jenkins](#jenkins)","Command Line Tools"],"readme":"# DEPRECATED: Kubediff\n\nKubediff is a tool for Kubernetes to show you the differences between your\nrunning configuration and your version controlled configuration.\n\nKubediff can be run from the command line:\n\n    $ ./kubediff\n    usage: kubediff [-h] [--kubeconfig KUBECONFIG] [--context CONTEXT] [--namespace NAMESPACE] [--json] [--no-error-on-diff] [paths ...]\n\n         _          _             _  _   __   __\n        | |__ _  _ | |__  ___  __| |(_) / _| / _|\n        | / /| || || '_ \\/ -_)/ _` || ||  _||  _|\n        |_\\_\\ \\_,_||_.__/\\___|\\__,_||_||_|  |_|\n\n        Compare yaml files in path(s) to running state in kubernetes and print the\n        differences. This is useful to ensure you have applied all your changes\n        to the appropriate environment. This tools runs kubectl, so unless your\n        ~/.kube/config is configured for the correct environment, you will need\n        to supply the kubeconfig for the appropriate environment.\n\n    positional arguments:\n      paths                  path(s) from which kubediff will look for configuration files\n\n    optional arguments:\n      -h, --help            show this help message and exit\n      --kubeconfig KUBECONFIG, -k KUBECONFIG\n                            path to kubeconfig\n      --context CONTEXT, -c CONTEXT\n                            name of kubeconfig context to use\n      --namespace NAMESPACE, -n NAMESPACE\n                            Namespace to assume for objects where it is not specified (default = Kubernetes default for current context)\n      --json, -j            output in json format\n      --no-error-on-diff, -e\n                            don't exit with 2 if diff exists\n\nFor example:\n\n    $ ./kubediff k8s\n    Checking ReplicationController 'kubediff'\n     *** .spec.template.spec.containers[0].args[0]: '-repo=https://github.com/weaveworks/kubediff' != '-repo=https://github.com/\u003cyour github repo\u003e'\n    Checking Secret 'kubediff-secret'\n    Checking Service 'kubediff'\n\nMake sure the dependencies are installed first:\n\n    $ pip install -r requirements.txt\n\nKubediff can also be run as a service on Kubernetes, periodically downloading the\nlatest configuration from Github, comparing it to the running configuration.  In\nthis mode Kubediff will also offers a very simple UI showing the output and\nexport the result to Prometheus, all courtesy to [prom-run](https://github.com/tomwilkie/prom-run).\n\nTo deploy to Kubernetes, you much first make a copy of the YAML files in `k8s`\nand update the following fields:\n\n- `kubediff-rc.yaml` the first argument to git-sync must be the location of\n  the config repo, and the last argument to kubediff must the the location\n  in this repo of your config.\n- `kubediff-secret.yaml` the username and password must be set to valid\n  [github OAuth token](https://developer.github.com/guides/managing-deploy-keys/#https-cloning-with-oauth-tokens).\n\nOnce you have updated the config, the following commands should bring up\nthe service:\n\n    $ kubectl create -f k8s\n    replicationcontroller \"kubediff\" created\n    secret \"kubediff-secret\" created\n    service \"kubediff\" created\n\nAnd to view the UI, run the follow command and go to [http://localhost:4040](http://localhost:4040)\n\n    `$ kubectl port-forward $(kubectl get pod --selector=name=kubediff -o jsonpath={.items..metadata.name}) 4040:80`\n\n![Kubediff Screenshot](/imgs/screenshot.png)\n\nThis service exports the exit code of the kubediff as a Prometheus metric;\na suitable alert can be setup for persistent differences:\n\n    ALERT Kubediff\n      IF          max(command_exit_code{job=\"kubediff\"}) != 0\n      FOR         2h\n      LABELS      { severity=\"warning\" }\n      ANNOTATIONS {\n        summary = \"Kubediff has detected a difference in running config.\",\n        description = \"Kubediff has detected a difference in running config.\",\n      }\n\nThese alerts can be sent to Slack, for example:\n\n![Slack Alert](/imgs/alert.png)\n\n## compare-images\n\nTo quickly see how two sets of configurations differ, purely in terms of\nimages:\n\n    $ ./compare-images ../service-conf/k8s/dev/ ../service-conf/k8s/prod/\n    Image                          dev                   prod\n    -----------------------------  --------------------  --------------------\n    quay.io/weaveworks/grafana     master-0fc7cc2        master-08fd09d\n    quay.io/weaveworks/prometheus  master-0fc7cc2        master-4fb2aed\n    quay.io/weaveworks/ui-server   master-2899c36        master-45d67b3\n    tomwilkie/prometheus           frankenstein-8a5ec1b  frankenstein-ebe5808\n    weaveworks/scope               master-1a1021c        master-14d0e4e\n\n## Build\n\n    mkdir -p $GOPATH/src/github.com/prometheus \u0026\u0026 cd \"$_\"\n    git clone git@github.com:prometheus/client_golang.git\n    mkdir -p $GOPATH/src/github.com/weaveworks \u0026\u0026 cd \"$_\"\n    git clone git@github.com:weaveworks/kubediff.git\n    cd kubediff\n    make\n\n## Getting Help\n\nIf you have any questions about, feedback for or problems with `kubediff`:\n\n- Invite yourself to the \u003ca href=\"https://slack.weave.works/\" target=\"_blank\"\u003eWeave Users Slack\u003c/a\u003e.\n- Ask a question on the [#general](https://weave-community.slack.com/messages/general/) slack channel.\n- [File an issue](https://github.com/weaveworks/kubediff/issues/new).\n\nWeaveworks follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting a Weaveworks project maintainer, or Alexis Richardson (alexis@weave.works).\n\nYour feedback is always welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweaveworks%2Fkubediff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweaveworks%2Fkubediff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweaveworks%2Fkubediff/lists"}