Hello, lets say we have a large Kubernetes cluster implying we have a lot of nam . . .

Manpreet Singh:
Hello, lets say we have a large Kubernetes cluster implying we have a lot of namespaces, services, pods, nodes. Now, we understand ETCD is what stores the state of all these components i.e pods, nodes etc but what path will I be able to retrieve this Key-Value information from for a particular namespace for example.

Manpreet Singh:
From the lecture, I understood its in /registry/* is it?

Manpreet Singh:

Manpreet Singh:
@Malayamanas Panda

Malayamanas Panda:
@Manpreet Singh #! /bin/bash

Get kubernetes keys from etcd

Install python module json # pip install json

export ETCDCTL_API=3
keys = $(etcdctl --endpoints=127.0.0.1:2379 --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key get /registry --prefix -w json | python -m json.tool | grep key | cut -d " : " -f2 | tr -d ’ " ’ | tr -d " , " )
for x in $keys ; do
echo $x | base64 -d | sort
done