{"id":16879985,"url":"https://github.com/aledbf/k8s-dump","last_synced_at":"2025-03-20T02:32:20.058Z","repository":{"id":57631247,"uuid":"81358174","full_name":"aledbf/k8s-dump","owner":"aledbf","description":"Dump object from a running Kubernetes cluster","archived":false,"fork":false,"pushed_at":"2017-02-11T21:23:46.000Z","size":3557,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-25T05:24:54.497Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/aledbf.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}},"created_at":"2017-02-08T17:47:15.000Z","updated_at":"2021-09-24T10:05:36.000Z","dependencies_parsed_at":"2022-09-26T20:11:40.810Z","dependency_job_id":null,"html_url":"https://github.com/aledbf/k8s-dump","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/aledbf%2Fk8s-dump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aledbf%2Fk8s-dump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aledbf%2Fk8s-dump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aledbf%2Fk8s-dump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aledbf","download_url":"https://codeload.github.com/aledbf/k8s-dump/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244538556,"owners_count":20468734,"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":[],"created_at":"2024-10-13T15:56:49.075Z","updated_at":"2025-03-20T02:32:20.017Z","avatar_url":"https://github.com/aledbf.png","language":"Go","readme":"# k8s-dump\nDump objects from a running Kubernetes cluster\n\n**Build:** run `go build`\n\n**Options:**\n```\n./dump --help\n      --alsologtostderr                  log to standard error as well as files\n      --apiserver-host string            The address of the Kubernetes Apiserver to connect to in the format of protocol://address:port, e.g., http://localhost:8080. If not specified, the assumption is that the binary runs inside a Kubernetes cluster and local discovery is attempted.\n      --kubeconfig string                Path to kubeconfig file with authorization and master location information.\n      --log_backtrace_at traceLocation   when logging hits line file:N, emit a stack trace (default :0)\n      --log_dir string                   If non-empty, write log files in this directory\n      --logtostderr                      log to standard error instead of files\n      --namespace string                 Only dump the contents of a particular namespace.\n      --output string                    Directory where the dump files should be created.\n      --skip-types stringSlice           Types to skip in the dump.  (default [serviceaccount])\n      --stderrthreshold severity         logs at or above this threshold go to stderr (default 2)\n      -v, --v Level                          log level for V logs\n      --vmodule moduleSpec               comma-separated list of pattern=N settings for file-filtered logging\n```\n\nIn a terminal open a proxy connection to the cluster using kubectl:\n```\nkubectl proxy --port=8080\nStarting to serve on 127.0.0.1:8080\n```\n\n**Running the command:**\n```\n./dump \\\n    --output=$PWD/out \\\n    --apiserver-host=http://127.0.0.1:8080\n\n```\n\nwill dump all the object types (excluding service accounts) in the directory `--output` creating one file per namespace.\nEach\n\n```\n./dump --output=/Users/aledbf/go/src/k8s.io/dump/out --apiserver-host=http://127.0.0.1:8080\nI0208 21:00:09.493695   64091 main.go:116] Creating API server client for http://127.0.0.1:8080\nI0208 21:00:09.883821   64091 main.go:146] Dumping cluster objects...\nI0208 21:00:09.883845   64091 main.go:218] \tdumping namespace xxxxxxx\nI0208 21:00:13.830584   64091 main.go:218] \tdumping namespace xxxxxxx\n...\nI0208 21:00:19.830584   64091 main.go:158] \tdone.\n```\n\nExample of a file:\n````\n\n# errors:\n\n# there is no objects of type statefulsets in namespace xxxxxx\n# there is no objects of type storageclasses in namespace xxxxxx\n# there is no objects of type persistentvolumes in namespace xxxxxx\n# there is no objects of type podsecuritypolicies in namespace xxxxxx\n# there is no objects of type thirdpartyresources in namespace xxxxxx\n\n# namespace\napiVersion: v1\nkind: Namespace\nmetadata:\n  name: xxxxxx\n\n---\n\n# deployments\n\n......\n---\n\n# endpoints\n\n......\n---\n\n# replicasets\n\n......\n---\n\n# secrets\n\n......\n---\n\n# services\n\n......\n---\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faledbf%2Fk8s-dump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faledbf%2Fk8s-dump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faledbf%2Fk8s-dump/lists"}