Directly access data objects stored in etcd by Kubernetes.
Go to file
Siyuan Zhang 663a60707b
Merge pull request #325 from hwdef/main
2025-07-10 08:50:35 -07:00
.github build(deps): bump actions/setup-go from 5.4.0 to 5.5.0 2025-05-12 00:18:10 +00:00
augerctl chore: align golangci-lint config with etcd 2025-03-04 20:05:06 +01:00
cmd chore: align golangci-lint config with etcd 2025-03-04 20:05:06 +01:00
hack Automatically updating scheme and passed codecs 2024-04-03 10:10:44 +08:00
pkg chore(CI): add gci formatter 2025-06-17 14:06:07 +02:00
scripts chore: use go tools from go 1.24 2025-03-02 22:43:11 +01:00
tools chore(CI): add gci formatter 2025-06-17 14:06:07 +02:00
.gitignore chore: add release workflow and documentation 2024-10-24 06:56:28 +02:00
.goreleaser.yaml fix: correct the build args version injection 2024-11-18 14:39:02 +01:00
CONTRIBUTING.md Add kubernetes project boilerplate files. 2023-12-04 08:49:45 +13:00
Dockerfile chore(main): Bump Go to 1.24.5 2025-07-10 16:55:57 +08:00
LICENSE Add OSS license and policy files. 2017-07-31 12:25:18 -07:00
Makefile chore: use go tools from go 1.24 2025-03-02 22:43:11 +01:00
OWNERS Update OWNERS before repository move. 2023-12-04 08:54:15 +13:00
README.md Remove defunct makefile recipes for release. 2024-11-17 19:48:06 +01:00
RELEASE.md chore: add release workflow and documentation 2024-10-24 06:56:28 +02:00
REVIEWING.md Add OSS license and policy files. 2017-07-31 12:25:18 -07:00
SECURITY.md Add kubernetes project boilerplate files. 2023-12-04 08:49:45 +13:00
SECURITY_CONTACTS Add kubernetes project boilerplate files. 2023-12-04 08:49:45 +13:00
code-of-conduct.md Add kubernetes project boilerplate files. 2023-12-04 08:49:45 +13:00
go.mod Merge pull request #325 from hwdef/main 2025-07-10 08:50:35 -07:00
go.sum Merge pull request #324 from etcd-io/dependabot/go_modules/github.com/sashamelentyev/usestdlibvars-1.29.0 2025-07-09 22:59:06 +12:00
main.go Update package name to etcd-io 2024-02-17 21:27:23 -08:00

README.md

Auger

Directly access data objects stored in etcd by kubernetes.

Encodes and decodes Kubernetes objects from the binary storage encoding used to store data to etcd. Supports data conversion to YAML, JSON and Protobuf.

Automatically determines if etcd data is stored in JSON (kubernetes 1.5 and earlier) or binary (kubernetes 1.6 and newer) and decodes accordingly.

Why?

In earlier versions of kubernetes, data written to etcd was stored as JSON and could easily be inspected or manipulated using standard tools such as etcdctl. In kubernetes 1.6+, for efficiency reasons, much of the data is now stored in a binary storage representation, and is non-trivial to decode-- it contains a enveloped payload that must be unpacked, type resolved and decoded.

This tool provides kubernetes developers and cluster operators with simple way to access the binary storage data via YAML and JSON.

Installation

Check out and build:

git clone https://github.com/etcd-io/auger
cd auger
make build

Run:

build/auger -h

Use cases

Access data via etcdctl

A kubernetes developer or cluster operator needs to inspect the data actually stored to etcd for a particular kubernetes object.

E.g., decode a pod from etcd v3, where <pod-name> is the name of one of your pods:

ETCDCTL_API=3 etcdctl get /registry/pods/default/<pod-name> | auger decode
> apiVersion: v1
> kind: Pod
> metadata:
>   annotations: ...
>   creationTimestamp: 2017-06-27T16:35:34Z
> ...

Modify data via etcdctl

A kubernetes developer or etcd developer needs to modify state of an object stored in etcd.

E.g. Write an updated pod to etcd v3:

cat updated-pod.yaml | auger encode | ETCDCTL_API=3 etcdctl put /registry/pods/default/<pod-name>

Access data directly from db file

A cluster operator, kubernetes developer or etcd developer is needs to inspect etcd data without starting etcd. In extreme cases, it may not be possible to start etcd and inspecting the data may help a etcd developer understand what state it is in.

E.g. find an etcd value by it's key and extract it from a boltdb file:

auger extract -f <boltdb-file> -k /registry/pods/default/<pod-name>
> apiVersion: v1
> kind: Pod
> metadata:
>   annotations: ...
>   creationTimestamp: 2017-06-27T16:35:34Z
> ...

Query for specific data directly from a db file:

auger extract -f <boltdb-file> --template="{{.Value.kind}} {{.Value.metadata.name}}" --filter=".Value.metadata.namespace=default"
> Endpoints kubernetes
> Service kubernetes
> ...

Consistency and corruption checking

First get a checksum and latest revsion from one of the members:

auger checksum -f <member-1-boltdb-file>
> checksum: 1282050701
> revision: 7

Then compare it with the other members:

auger checksum -f <member-2-boltdb-file> -r 7
> checksum: 1282050701
> revision: 7

auger checksum -f <member-3-boltdb-file> -r 7
> checksum: 8482350767
> revision: 7
# Oh noes! The checksum should have been the same!