0

I have a 2 node kubernetes cluster with calico networking. All the pods are up and running.

NAMESPACE     NAME                                       READY     STATUS    RESTARTS   AGE

kube-system   calico-etcd-94466                          1/1       Running   0          21h
kube-system   calico-kube-controllers-5fdcfdbdf7-xsjxb   1/1       Running   0          14d
kube-system   calico-node-hmnf5                          2/2       Running   0          14d
kube-system   calico-node-vmmmk                          2/2       Running   0          14d
kube-system   coredns-78fcdf6894-dlqg6                   1/1       Running   0          14d
kube-system   coredns-78fcdf6894-zwrd6                   1/1       Running   0          14d
kube-system   etcd-kube-master-01                        1/1       Running   0          14d
kube-system   kube-apiserver-kube-master-01              1/1       Running   0          14d
kube-system   kube-controller-manager-kube-master-01     1/1       Running   0          14d
kube-system   kube-proxy-nxfht                           1/1       Running   0          14d
kube-system   kube-proxy-qnn45                           1/1       Running   0          14d
kube-system   kube-scheduler-kube-master-01              1/1       Running   0          14d

I wanted to query calico-etcd using etcdctl, but I get the following error.

# etcdctl --debug --endpoints "http://10.142.137.11:6666" get calico
start to sync cluster using endpoints(http://10.142.137.11:6666)
cURL Command: curl -X GET http://10.142.137.11:6666/v2/members
got endpoints(http://10.142.137.11:6666) after sync
Cluster-Endpoints: http://10.142.137.11:6666
cURL Command: curl -X GET http://10.142.137.11:6666/v2/keys/calico?quorum=false&recursive=false&sorted=false
Error:  100: Key not found (/calico) [4]

Any pointers on why I get this error?

Pradeep
  • 1,198
  • 3
  • 12
  • 22
  • Do etcdctl queries for other resources work? – Nicola Ben Sep 04 '18 at 07:39
  • 2
    Can you try getting all keys from etcd and add output? `ETCDCTL_API=3 etcdctl get / --prefix --keys-only` – Jakub Bujny Sep 04 '18 at 07:54
  • Could you explain please what was the problem :)? I would really appreciate if you can up vote my comment if I helped ^_^ – Jakub Bujny Sep 04 '18 at 08:00
  • I think the API version is 2 by default. The output for the above command is `/calico/ipam/v2/assignment/ipv4/block/192.168.201.64-26 /calico/ipam/v2/assignment/ipv4/block/192.168.212.128-26 /calico/ipam/v2/handle/k8s-pod-}network.1346353eeb0bdd5a5cbbb965105990076a6809a541633466b4928e230c67f834 ` But when I execute the below command I don't see any output: `etcdctl --endpoints "10.142.137.11:6666"; get /calico/` – Pradeep Sep 04 '18 at 09:49

1 Answers1

1

As @JakubBujny mentioned, ETCDCTL_API=3 should be set to get the appropriate result.

Akar
  • 574
  • 3
  • 8
  • I had to do: `etcdctl get /calico/ipam/v2/assignment/ipv4/block/192.168.201.64-26 --prefix` to make it work – Pradeep Sep 10 '18 at 10:54