Welcome to the Linux Foundation Forum!

LAB 4.1 Backing-up etcd

Posts: 115
edited August 2022 in LFS258 Class Forum

Hello!
I was wondering if there's any practical difference between the following two commands:

  1. kubectl -n kube-system exec -it etcd-k8s-cp -- sh -c "ETCDCTL_API=3 \
  2. ETCDCTL_CACERT=/etc/kubernetes/pki/etcd/ca.crt \
  3. ETCDCTL_CERT=/etc/kubernetes/pki/etcd/server.crt \
  4. ETCDCTL_KEY=/etc/kubernetes/pki/etcd/server.key \
  5. etcdctl endpoint health"

and

  1. kubectl -n kube-system exec -it etcd-k8s-cp –- sh -c "etcdctl \
  2. --cacert=/etc/kubernetes/pki/etcd/ca.crt \
  3. --cert=/etc/kubernetes/pki/etcd/server.crt \
  4. --key=/etc/kubernetes/pki/etcd/server.key \
  5. endpoint health"

The only thing I see is that with the 2nd command we cannot pass api version, but the command works fine without it. Is there any reason we should use env variables rather than etcdctl parameters?

Thanks in advance!

Comments

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training