Welcome to the Linux Foundation Forum!

is this really necessary: ETCDCTL_API=3

with the goal of making things simpler and save precious time, I wonder if this environment variable that is specified in the doc for etcdctl is really necessary?
In my kubeadm 1.20.2 cluster it looks like that etcd already default to api v3:

kubectl -nkube-system exec pod/etcd-wf-st-cctr1 -- sh -c 'ETCDCTL_API=3 etcdctl --endpoints=https://127.0.0.1:2379 --cacert="/etc/kubernetes/pki/etcd/ca.crt" --cert="/etc/kubernetes/pki/etcd/peer.crt" --key="/etc/kubernetes/pki/etcd/peer.key" version'
etcdctl version: 3.4.13
API version: 3.4

kubectl -nkube-system exec pod/etcd-wf-st-cctr1 -- sh -c 'etcdctl --endpoints=https://127.0.0.1:2379 --cacert="/etc/kubernetes/pki/etcd/ca.crt" --cert="/etc/kubernetes/pki/etcd/peer.crt" --key="/etc/kubernetes/pki/etcd/peer.key" version'
etcdctl version: 3.4.13
API version: 3.4

Comments

  • chrispokornichrispokorni Posts: 1,065

    Hi @ltosolini,

    With the release of etcd version 3, the export of the v3 variable was necessary early on because it was still supporting both API versions, v2 and v3, and it was defaulting to v2. At this point v3 may be mature enough and the API may already default to v3, in which case the variable export may no longer be needed.

    Regards,
    -Chris

Sign In or Register to comment.