{"id":46051279,"url":"https://github.com/ahmetb/etcdedit","last_synced_at":"2026-03-13T05:13:19.530Z","repository":{"id":341302244,"uuid":"1169627526","full_name":"ahmetb/etcdedit","owner":"ahmetb","description":"Directly edit Kubernetes resources stored in etcd","archived":false,"fork":false,"pushed_at":"2026-03-01T07:03:21.000Z","size":62,"stargazers_count":11,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-05T15:16:43.166Z","etag":null,"topics":["etcd","etcd-client","etcd-manage","etcdv3"],"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/ahmetb.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-01T00:47:24.000Z","updated_at":"2026-03-04T18:33:21.000Z","dependencies_parsed_at":"2026-03-02T10:01:11.336Z","dependency_job_id":null,"html_url":"https://github.com/ahmetb/etcdedit","commit_stats":null,"previous_names":["ahmetb/etcdedit"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ahmetb/etcdedit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetb%2Fetcdedit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetb%2Fetcdedit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetb%2Fetcdedit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetb%2Fetcdedit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahmetb","download_url":"https://codeload.github.com/ahmetb/etcdedit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetb%2Fetcdedit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30180638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T12:39:21.703Z","status":"ssl_error","status_checked_at":"2026-03-06T12:36:09.819Z","response_time":250,"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":["etcd","etcd-client","etcd-manage","etcdv3"],"created_at":"2026-03-01T09:00:47.603Z","updated_at":"2026-03-07T15:00:49.287Z","avatar_url":"https://github.com/ahmetb.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# etcdedit\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://pkg.go.dev/github.com/ahmetb/etcdedit\"\u003e\n    \u003cimg src=\"https://pkg.go.dev/badge/github.com/ahmetb/etcdedit.svg\" alt=\"Go Reference\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/ahmetb/etcdedit/blob/main/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/ahmetb/etcdedit\" alt=\"License\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nDirectly edit Kubernetes resources stored in etcd, bypassing the API server.\n\n\u003e [!WARNING]\n\u003e This is a brain surgery tool, use with caution.\n\nThis tool directly deals with Kubernetes proto binary encoding (and JSON\nencoding for CRDs) so it may cause loss of certain fields depending on which\nkubernetes server version you're using.\n\n## Why?\n\nSometimes you need to directly access the data stored in etcd:\n\n- Recover from a broken cluster state, or restore admin access to the cluster\n- Inspect or modify resources when the API server is unavailable\n- Load the cluster with objects as fast as possible for stress testing\n\n## Installation\n\n```bash\nbrew tap ahmetb/etcdedit https://github.com/ahmetb/etcdedit\nbrew install etcdedit\n```\n\n```bash\ngo install github.com/ahmetb/etcdedit@latest\n```\n\n## Usage\n\nSet credentials in the env (or --flags) the same way you would for `etcdctl`:\n\n```bash\nexport ETCDCTL_ENDPOINTS=https://127.0.0.1:2379\nexport ETCDCTL_CACERT=/etc/kubernetes/pki/etcd/ca.crt\nexport ETCDCTL_CERT=/etc/kubernetes/pki/etcd/server.crt\nexport ETCDCTL_KEY=/etc/kubernetes/pki/etcd/server.key\n```\n\n- **Get a key**: retrieve a resource from etcd\n\n  ```bash\n  etcdedit get /registry/pods/default/nginx\n  ```\n\n- **Edit a resource **: launches  $EDITOR (default: vim) to modify a resource\n  in place. Before applying the change the original etcd value is saved to a\n  temp file.\n\n  ```bash\n  etcdedit edit /registry/pods/default/nginx\n  ```\n\n- **Apply**: replace the etcd key with a given YAML manifest\n\n  ```bash\n  etcdedit apply -f manifest.yaml /registry/pods/default/my-pod\n  ```\n\n## etcd Kubernetes Key Paths\n\nYou should always run `etcdctl get --keys-only --prefix \u003cPREFIX\u003e` to figure\nout which key you should be replacing (**do not guess**).\n\n\nMost of the key format looks like this:\n```text\n/registry/\u003cresource\u003e/\u003cnamespace\u003e/\u003cname\u003e         # namespaced\n/registry/\u003cresource\u003e/\u003cname\u003e                     # cluster-scoped\n/registry/\u003cgroup\u003e/\u003cresource\u003e/\u003cnamespace\u003e/\u003cname\u003e # CRD\n```\nbut nothing is guaranteed since this is an implementation detail of the\nAPI server.\n\n## Examples\n\n- Create a ConfigMap (name/namespace derived from key path):\n\n  ```bash\n  etcdedit apply -f - /registry/configmaps/default/my-config \u003c\u003cEOF\n  apiVersion: v1\n  kind: ConfigMap\n  metadata:\n    labels:\n      foo: bar\n  data:\n    key1: value1\n  EOF\n  ```\n\n- Restore `cluster-admin` ClusterRoleBinding to a user:\n\n  ```bash\n  etcdedit apply -f - /registry/clusterrolebindings/tmp-admin \u003c\u003cEOF\n  apiVersion: rbac.authorization.k8s.io/v1\n  kind: ClusterRoleBinding\n  roleRef:\n    apiGroup: rbac.authorization.k8s.io\n    kind: ClusterRole\n    name: cluster-admin\n  subjects:\n  - apiGroup: rbac.authorization.k8s.io\n    kind: User\n    name: ahmet # change your username!\n  EOF\n  ```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmetb%2Fetcdedit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmetb%2Fetcdedit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmetb%2Fetcdedit/lists"}