CKA Mock Exam 2 Q16

I am getting an error for question 16 “etcdctl: command not found”.

cluster4-controlplane ~ :heavy_multiplication_x: ETCDCTL_API=3 etcdctl --endpoints=https://[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 snapshot save /opt/etcd-boot-cka18-trb.db
-bash: etcdctl: command not found

cluster4-controlplane ~ :heavy_multiplication_x: k get po -A
NAMESPACE NAME READY STATUS RESTARTS AGE
default pink-pod-cka16-trb 1/1 Running 0 39m
ingress-nginx ingress-nginx-admission-create-wncgc 0/1 Completed 0 39m
ingress-nginx ingress-nginx-admission-patch-rvjtp 0/1 Completed 0 39m
ingress-nginx ingress-nginx-controller-59c48c9f5c-lrqph 1/1 Running 0 39m
kube-system etcd-cluster4-controlplane 1/1 Running 0 18m
kube-system kube-apiserver-cluster4-controlplane 1/1 Running 7 (21m ago) 30m
kube-system kube-controller-manager-cluster4-controlplane 1/1 Running 6 (27m ago) 95m
kube-system kube-proxy-kt44n 1/1 Running 0 94m
kube-system kube-proxy-t7wss 1/1 Running 0 94m
kube-system kube-scheduler-cluster4-controlplane 1/1 Running 6 (27m ago) 95m
kube-system metrics-server-59d58ccd57-nnzrs 1/1 Running 0 68m
kube-system weave-net-6dzp7 2/2 Running 1 (94m ago) 94m
kube-system weave-net-6pg6m 2/2 Running 0 94m

This is probably a bug in the lab, and we have a task in our internal tracking system for it. But there’s a work-around: you can install etcdctl using the apt utility:

apt update
apt install etcd-client

When I tried the lab, however, it was installed:

cluster4-controlplane ~ ➜  type etcdctl
etcdctl is /usr/local/bin/etcdctl

cluster4-controlplane ~ ➜  etcdctl version
etcdctl version: 3.5.15
API version: 3.5

We do have cases where items that the setup scripts should install are not installed occasionally; this is probably the case here with you.

Also the above should not work even is etcdctl is present. A valid IP address does not have square brackets.

You can safely omit --endpoints if you are running the command on the controlplane. etcdctl knows the default address of etcd server, so it is less typing, and in the exam typing=time spent.