<p>I'm trying to retrieve values from etcd v3 in a kubernetes cluster. The values appear to be encoded and don't come back complete. When <code>-w simple</code>, the value comes back with a lot of question marks in little diamonds. When using <code>-w json</code>, the value comes back like this:</p>

<pre><code>ubuntu@k8s-master-0:~$ etcdctl --endpoints=https://127.0.0.1:2379 -w json get /registry/services/specs/default/kubernetes-bootcamp
{"header":{"cluster_id":13533136872321707204,"member_id":12171258639343793897,"revision":1142056,"raft_term":53},"kvs":[{"key":"L3JlZ2lzdHJ5L3NlcnZpY2VzL3NwZWNzL2RlZmF1bHQva3ViZXJuZXRlcy1ib290Y2FtcA==","create_revision":863556,"mod_revision":863556,"version":1,"value":"azhzAAoNCgJ2MRIHU2VydmljZRLaAQp3ChNrdWJlcm5ldGVzLWJvb3RjYW1wEgAaB2RlZmF1bHQiACokNzBhNDdlZDgtODFjZS0xMWU3LWE2ZGMtZmExNjNlYmZlNzM5MgA4AEILCLOmzMwFEOaHwTdaGgoDcnVuEhNrdWJlcm5ldGVzLWJvb3RjYW1wegASWwoXCgASA1RDUBiYPyIHCAAQkD8aACjR+QESGgoDcnVuEhNrdWJlcm5ldGVzLWJvb3RjYW1wGgwxMC4yMzMuNTIuNzEiDExvYWRCYWxhbmNlcjoETm9uZUIAUgAaAgoAGgAiAA=="}],"count":1}
</code></pre>

<p>The key and value appear to be encoded, but I can't find a way to get the plain text value back.</p>

<p>How can I get the plain text value for a given key?</p>

<p>A bit late to the show but here is how I was able to do that.
Because in etcd pre-v3 the data was stored in plain <code>json</code> and since v3 it is in binary format the additional decode step is needed.</p>

<p>You may check this repo for details: 
<a href="https://github.com/jpbetz/auger" rel="nofollow noreferrer">https://github.com/jpbetz/auger</a></p>

<p>And <a href="https://kubernetes.io/docs/reference/using-api/api-concepts/#protobuf-encoding" rel="nofollow noreferrer">here</a> are Kubernetes docs regarding protobuf encoding</p>

<p>And the working example is:</p>

<pre><code>etcdctl get "/registry/pods/default/nginx-dbddb74b8-62hh7" --prefix -w simple | auger decode
</code></pre>

<p>Now the response is plain-text:</p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  annotations:
    kubernetes.io/limit-ranger: 'LimitRanger plugin set: cpu request for container
      nginx'
  creationTimestamp: 2019-08-12T14:11:57Z
...
</code></pre>
