etcdデーターを覗く
Closed this issue · 0 comments
ptux commented
refs
https://stackoverflow.com/questions/45744534/etcd-v3-cant-read-encoded-values
steps
git clone https://github.com/jpbetz/auger
cd auger
make release
build/auger -h
controlplane $ kubectl run --namespace=default --image=nginx nginx2 -v8
I1206 08:07:49.583600 12349 loader.go:375] Config loaded from file: /root/.kube/config
I1206 08:07:49.592580 12349 request.go:1068] Request Body: {"kind":"Pod","apiVersion":"v1","metadata":{"name":"nginx2","creationTimestamp":null,"labels":{"run":"nginx2"}},"spec":{"containers":[{"name":"nginx2","image":"nginx","resources":{}}],"restartPolicy":"Always","dnsPolicy":"ClusterFirst"},"status":{}}
I1206 08:07:49.592859 12349 round_trippers.go:420] POST https://172.17.0.34:6443/api/v1/namespaces/default/pods
I1206 08:07:49.593007 12349 round_trippers.go:427] Request Headers:
I1206 08:07:49.593142 12349 round_trippers.go:431] Accept: application/json, */*
I1206 08:07:49.593281 12349 round_trippers.go:431] Content-Type: application/json
I1206 08:07:49.593408 12349 round_trippers.go:431] User-Agent: kubectl/v1.18.0 (linux/amd64) kubernetes/9e99141
I1206 08:07:49.615734 12349 round_trippers.go:446] Response Status: 201 Created in 22 milliseconds
I1206 08:07:49.615917 12349 round_trippers.go:449] Response Headers:
I1206 08:07:49.616041 12349 round_trippers.go:452] Content-Type: application/json
I1206 08:07:49.616132 12349 round_trippers.go:452] Content-Length: 1735
I1206 08:07:49.616248 12349 round_trippers.go:452] Date: Mon, 06 Dec 2021 08:07:49 GMT
I1206 08:07:49.616461 12349 request.go:1068] Response Body: {"kind":"Pod","apiVersion":"v1","metadata":{"name":"nginx2","namespace":"default","selfLink":"/api/v1/namespaces/default/pods/nginx2","uid":"15d845e0-344e-48b9-b75b-896878781e97","resourceVersion":"3441","creationTimestamp":"2021-12-06T08:07:49Z","labels":{"run":"nginx2"},"managedFields":[{"manager":"kubectl","operation":"Update","apiVersion":"v1","time":"2021-12-06T08:07:49Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:labels":{".":{},"f:run":{}}},"f:spec":{"f:containers":{"k:{\"name\":\"nginx2\"}":{".":{},"f:image":{},"f:imagePullPolicy":{},"f:name":{},"f:resources":{},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{}}},"f:dnsPolicy":{},"f:enableServiceLinks":{},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:terminationGracePeriodSeconds":{}}}}]},"spec":{"volumes":[{"name":"default-token-cz5f4","secret":{"secretName":"default-token-cz5f4","defaultMode":420}}],"containers":[{"name":"nginx2","image":"nginx","resources":{},"volumeMounts":[{"name":"default-token-cz5f4", [truncated 711 chars]
pod/nginx2 created
controlplane $
controlplane $ sudo ETCDCTL_API=3 etcdctl --cacert /etc/kubernetes/pki/etcd/ca.c/pki/apiserver-etcd-client.key get /registry/pods/default/nginx | build/auger decode