Welcome to the Linux Foundation Forum!

Lab 4.1 - etcd DB backup issues

chrispokornichrispokorni Posts: 809
edited December 2020 in LFS258 Class Forum

@dctheroux, your latest comments from a previous discussion thread, reporting issues on LFS258 Lab 4.1, have been moved here, to keep discussions organized and relevant to a specific topic.

The two prior comments from the other discussion thread shall be removed.

Please continue posting on this discussion thread with any additional issues encountered with the etcd DB backup exercise of Lab 4.1.

STEP 4:

Chris, I am getting this error when I try to see how many databases? I am using the command : kubectl -n kube-system exec -it etcd-master -- sh -c \
"ETCDCTL_API=3 etcdctl --cert=./peer.crt --key=./peer.key --cacert=./ca.crt \
--endpoints=https://127.0.0.1:2379 member list" . So, after I initiate the command it gives me the error : Error: open ./peer.crt: no such file or directory
command terminated with exit code 128. I read that openshift has a bug with this. This is exercise 4.1 and the printout it says I should be getting is this: fb50b7ddbf4930ba, started, master, https://10.128.0.35:2380,
2 https://10.128.0.35:2379, false. instead I am getting the error. I think perhaps it is a bug or maybe the command spacing again. I tried typing it and copy and paste it to no avail. the chart works fine and I copied and pasted and typed it for practice. I checked and it has all the files were I saved them from in the etcd shell. please advise? Thank You!

STEP 6:

I cant get passed item 6 in the first lab of chapter 4. It might be working but none of the output looks like what you have printed out on the screen. number 6 seems to bring me into a sub shell of some sort and that is this command: kubectl -n kube-system exec -it etcd-master -- sh -c "ETCDCTL_API=3 \
ETCDCTL_CACERT=/etc/kubernetes/pki/etcd/ca.crt ETCDCTL_CERT=/etc/kubernetes/pki/etcd/server.crt \
ETCDCTL_KEY=/etc/kubernetes/pki/etcd/server.key etcdctl --endpoints=https://127.0.0.1:2379 \
snapshot save /var/lib/etcd/snapshot.db. This command just puts me in another shell and i am not sure what to do with it.

Comments

  • @dctheroux,

    In step 4 you need to ensure you are using the correct etcd pod name. The same etcd pod name you have used in step 2 of this exercise, has to be reused in subsequent steps 3, 4, 5, and 6. In the lab manual, the etcd-master is the name of the author's pod - yours will have a slightly different name.

    In step 6 it seems that you are missing a closing double-quote (") at the very end of your command, right after ... snapshot.db.

    Regards,
    -Chris

  • Thank you Chris, Sorry for for that again I will make sure to start a new thread for each one, Let me try the things you have suggested. I used tab completion and it gave me master. which is the name of my master instance.

  • Hi @dctheroux,

    You could try providing the absolute path from Step 2 (b) when running Step 3, and update the ./peer... and ./ca.crt with /etc/kubernetes/pki/etcd/peer... and /etc/kubernetes/pki/etcd/ca.crt.

    Regards,
    -Chris

  • i did the absolute and it worked.

  • deepakgcpdeepakgcp Posts: 10
    edited December 2020

    This step needs to be reviewed and reupload to the course material.. I dont understand what do they mean by "50" in the second sentence and the command with ./ wont work. we need to provide the absolute path..

    Poor Documentation from Linux Foundation.. It seems like nobody reviewed the Lab Exercises..

  • coopcoop Posts: 660

    Poor Documentation from Linux Foundation.. It seems like nobody reviewed the Lab Exercises..

    K8s is updated every 3 months and so are the exams and the courses (even more often) and the upstream is constantly shifting in ways out of the course maintainers' control. Your snarky attitude is not helpful, so if you have very specific suggestions they are always welcome, but the course material is put through extensive review and testing at every step so your criticism is both inaccurate and unfair. I do not maintain this specific course but I am familiar with the process. Your tone is not one that welcomes productive collaboration between teacher and student. So please be more respectful, everyone else is.

  • I'm having issues on
    Exercise 4.1: Basic Node Maintenance

    1. Check the health of the database using the loopback IP and port 2379. You will need to pass then peer cert and key as
      well as the Certificate Authority as environmental variables. The command is commented, you do not need to type out
      the comments or the backslashes.
      [email protected]:˜$ kubectl -n kube-system exec -it etcd-master -- sh \ #Same as before
      -c "ETCDCTL_API=3 \ #Version to use
      ETCDCTL_CACERT=/etc/kubernetes/pki/etcd/ca.crt \ # Pass the certificate authority
      ETCDCTL_CERT=/etc/kubernetes/pki/etcd/server.crt \ #Pass the peer cert and key
      ETCDCTL_KEY=/etc/kubernete

    Could you kindly help please

  • serewiczserewicz Posts: 820

    @dino.farinha what is the error or issue you are encountering?

  • step 4 command, i was able to run, is like below. I think it is important where you put the word etcdctl between double-quote (").

    kubectl -n kube-system exec -it etcd-master -- sh -c "ETCDCTL_API=3 ETCDCTL_CACERT=/etc/kubernetes/pki/etcd/ca.crt ETCDCTL_CERT=/etc/kubernetes/pki/etcd/peer.crt ETCDCTL_KEY=/etc/kubernetes/pki/etcd/peer.key etcdctl --endpoints=https://127.0.0.1:2379 member list"

  • serewiczserewicz Posts: 820

    Hello,

    Correct, the placement of the command and how the shell parses the variables does have an effect. Good catch!

    Regards,

Sign In or Register to comment.