ETCD Client Installation Confusing With Link Given to Install it

In the Ultimate CKA Mock Exam Series on one of the questions it has you install the etcd client and gives you a link Releases · etcd-io/etcd · GitHub to do this. Tried running the commands from the instructions for this link but tar xzvf /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz -C /tmp/etcd-download-test --strip-components=1 doesn’t work. it says file not in gzip format. why can’t you just do an apt install etcd-client?

Not sure why this particular lab chooses to install an exact binary rather than use a package manager, but that’s sometimes the way with exams, mock or otherwise. I did a bit of testing with the commands from the RELEASE page, however, and they do work. I’m not sure why they would fail in your case.

do you just run each of these commands to install the etcd client then?

choose either URL

GOOGLE_URL=https://storage.googleapis.com/etcd
GITHUB_URL=https://github.com/etcd-io/etcd/releases/download
DOWNLOAD_URL=${GOOGLE_URL}

rm -f /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz
rm -rf /tmp/etcd-download-test && mkdir -p /tmp/etcd-download-test

curl -L ${DOWNLOAD_URL}/${ETCD_VER}/etcd-${ETCD_VER}-linux-amd64.tar.gz -o /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz
tar xzvf /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz -C /tmp/etcd-download-test --strip-components=1
rm -f /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz

/tmp/etcd-download-test/etcd --version
/tmp/etcd-download-test/etcdctl version
/tmp/etcd-download-test/etcdutl version

If you remove the “1” from the first line, the google archive is also valid. And yes, you can just run the directions on the release page to do this install, or you can modify the instructions to do it in a directory of your choice. But they do appear to be valid instructions.

the screenshot is the error that I get. what am I doing wrong?

Did you set ETCD_VER? I don’t see that in your output.

BTW: it’s better to put your output as “code blocks” rather than as an image, so it’s possible to copy and paste from it.

no i didn’t set ETCD_VER, that’s not included in the instructions and how/where would I use that? I have no idea what you’re talking about with “code blocks”, please explain further. just fyi the solution for this question in the lab is totally different from this. it has you use wget to install it.

You missed the top line of the script. From the release page you quoted:

ETCD_VER=v3.5.11

# choose either URL
GOOGLE_URL=https://storage.googleapis.com/etcd
GITHUB_URL=https://github.com/etcd-io/etcd/releases/download
DOWNLOAD_URL=${GOOGLE_URL}

rm -f /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz
rm -rf /tmp/etcd-download-test && mkdir -p /tmp/etcd-download-test

curl -L ${DOWNLOAD_URL}/${ETCD_VER}/etcd-${ETCD_VER}-linux-amd64.tar.gz -o /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz
tar xzvf /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz -C /tmp/etcd-download-test --strip-components=1
rm -f /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz

/tmp/etcd-download-test/etcd --version
/tmp/etcd-download-test/etcdctl version
/tmp/etcd-download-test/etcdutl version

The question will not pass until you move the etcd and etcdctl binaries into a directory that is in the system PATH, e.g. /usr/local/bin, because then they become “active” as it were, and can be run by any user without that user having to know which directory you downloaded them to.

installing the etcd-client puts the binary in path /usr/bin/etcdctl. so that’s wrong?

It’s not wrong, but it’s not what the grader is looking for in that lab. It’s looking in /usr/local/bin for both binaries.