<p>Kubernetes stores all its data on etcd but I can not find any documentation regarding the hierarchy in which those data are stored.</p>
<p>I have been looking around with no success at all so any help will be appreciated.</p>
<p>Thanks in advance.</p>

Jose Luis Ojosnegros Manchon
<p><code>Kubernetes</code> store the data in the following format:</p>
<pre><code>/registry/&lt;object-type&gt;/&lt;name-space&gt;/&lt;object-name&gt;
</code></pre>
<p><strong>Eg</strong>:</p>
<pre><code>/registry/pods/default/mypod
</code></pre>
<p>To get the details of a particular object:</p>
<p><strong>Syntax</strong>:</p>
<pre><code>export ETCDCTL_API=3
sudo etcdctl --endpoints &lt;etcd-server-endpoint-ip&gt; --cert=&lt;client-certificate&gt; --key=&lt;client-key&gt; --cacert=&lt;ca-certificate&gt; get /registry/&lt;object-type&gt;/&lt;name-space&gt;/&lt;object-name&gt;
</code></pre>
<p><strong>Example</strong>:</p>
<pre><code>sudo etcdctl --cert=/etc/ssl/etcd/ssl/node-kube-master.pem --key=/etc/ssl/etcd/ssl/node-kube-master-key.pem --cacert=/etc/ssl/etcd/ssl/ca.pem  get /registry/pods/default/foo
</code></pre>
<p>Output:</p>
<pre><code>/registry/pods/default/foo
k8s

v1Pod▒
▒
foodefault&quot;*$2b95568a-d1e8-4c50-9770-fe0a9ba6cbf02▒ˮ▒Z

runfooz▒▒

kubectl-runUpdatev▒ˮ▒FieldsV1:▒
▒{&quot;f:metadata&quot;:{&quot;f:labels&quot;:{&quot;.&quot;:{},&quot;f:run&quot;:{}}},&quot;f:spec&quot;:{&quot;f:containers&quot;:{&quot;k:{\&quot;name\&quot;:\&quot;foo\&quot;}&quot;:{&quot;.&quot;:{},&quot;f:image&quot;:{},&quot;f:imagePullPolicy&quot;:{},&quot;f:name&quot;:{},&quot;f:resources&quot;:{},&quot;f:terminationMessagePath&quot;:{},&quot;f:terminationMessagePolicy&quot;:{}}},&quot;f:dnsPolicy&quot;:{},&quot;f:enableServiceLinks&quot;:{},&quot;f:restartPolicy&quot;:{},&quot;f:schedulerName&quot;:{},&quot;f:securityContext&quot;:{},&quot;f:terminationGracePeriodSeconds&quot;:{}}}B▒▒
Go-http-clientUpdatev▒ˮ▒FieldsV1:▒
▒{&quot;f:status&quot;:{&quot;f:conditions&quot;:{&quot;k:{\&quot;type\&quot;:\&quot;ContainersReady\&quot;}&quot;:{&quot;.&quot;:{},&quot;f:lastProbeTime&quot;:{},&quot;f:lastTransitionTime&quot;:{},&quot;f:status&quot;:{},&quot;f:type&quot;:{}},&quot;k:{\&quot;type\&quot;:\&quot;Initialized\&quot;}&quot;:{&quot;.&quot;:{},&quot;f:lastProbeTime&quot;:{},&quot;f:lastTransitionTime&quot;:{},&quot;f:status&quot;:{},&quot;f:type&quot;:{}},&quot;k:{\&quot;type\&quot;:\&quot;Ready\&quot;}&quot;:{&quot;.&quot;:{},&quot;f:lastProbeTime&quot;:{},&quot;f:lastTransitionTime&quot;:{},&quot;f:status&quot;:{},&quot;f:type&quot;:{}}},&quot;f:containerStatuses&quot;:{},&quot;f:hostIP&quot;:{},&quot;f:phase&quot;:{},&quot;f:podIP&quot;:{},&quot;f:podIPs&quot;:{&quot;.&quot;:{},&quot;k:{\&quot;ip\&quot;:\&quot;10.233.120.2\&quot;}&quot;:{&quot;.&quot;:{},&quot;f:ip&quot;:{}}},&quot;f:startTime&quot;:{}}}Bstatus▒

▒.....redacting more info for clean output
</code></pre>
<p><strong>Getting the structure:</strong></p>
<p>Now, if you want to check the structure of the data stored in the <code>etcd</code> use <code>--prefix --keys-only</code>.</p>
<pre><code>sudo etcdctl --cert=&lt;client-certificate&gt; --key=&lt;client-key&gt; --cacert=&lt;ca-certificate&gt;  get /registry --prefix --keys-only
</code></pre>
<p><strong>Example</strong>:</p>
<pre><code>sudo etcdctl --cert=/etc/ssl/etcd/ssl/node-kube-master.pem --key=/etc/ssl/etcd/ssl/node-kube-master-key.pem --cacert=/etc/ssl/etcd/ssl/ca.pem  get /registry --prefix --keys-only
/registry/apiregistration.k8s.io/apiservices/v1.

/registry/apiregistration.k8s.io/apiservices/v1.admissionregistration.k8s.io

/registry/apiregistration.k8s.io/apiservices/v1.apiextensions.k8s.io

/registry/apiregistration.k8s.io/apiservices/v1.apps

/registry/apiregistration.k8s.io/apiservices/v1.authentication.k8s.io

/registry/apiregistration.k8s.io/apiservices/v1.authorization.k8s.io

/registry/apiregistration.k8s.io/apiservices/v1.autoscaling

/registry/apiregistration.k8s.io/apiservices/v1.batch

/registry/apiregistration.k8s.io/apiservices/v1.certificates.k8s.io
.....
</code></pre>
