Describe the issue: This issue is come from the PR discussion: https://github.com/openshift/openshift-docs/pull/11121#discussion_r206233884 as we know, in current ocp env, we run command 'etcdctl' is etcdctl2, and 'ETCDCTL_API=3 etcdctl' is etcdctl3, so why the doc still using: etcdctl2 & etcdctl3? actually, ectdctl2 & etcdctl3 is invalid command in ocp env just like this: sh-4.2# etcdctl2 sh: etcdctl2: command not found sh-4.2# sh-4.2# etcdctl3 sh: etcdctl3: command not found sh-4.2# sh-4.2# sh-4.2# sh-4.2# etcdctl --cert-file=/etc/etcd/peer.crt --key-file=/etc/etcd/peer.key --ca-file=/etc/etcd/ca.crt --peers=https://qe-geliu3xxx-etcd-1:2379 member list 72faa1d29ffc61d4: name=qe-geliu3master-etcd-1 peerURLs=https://10.xxx.0.xx:2380 clientURLs=https://10.xxx.0.xx:2379 isLeader=true sh-4.2# sh-4.2# sh-4.2# ETCDCTL_API=3 etcdctl --cert=/etc/etcd/peer.crt --key=/etc/etcd/peer.key --cacert=/etc/etcd/ca.crt --endpoints=https://qe-geliu3xxx-etcd-1:2379 endpoint health https://qe-geliu3xxx-etcd-1:2379 is healthy: successfully committed proposal: took = 1.153385ms Suggestions for improvement: etcdctl2&etcdctl3 is deprecated commands, it will result error execution in ocp env, so could it possible replace it with right way: etcdctl2 : etcdctl etcdctl3 : ETCDCTL_API=3 etcdctl Additional information: I still could find these commands in current doc also, such as: # etcdctl2 member list ....... # etcdctl3 member list .... in: https://docs.openshift.org/latest/day_two_guide/environment_backup.html#backing-up-etcd_environment-backup
Scott says that "etcdctl2 and etcdctl3 are bash functions that should be deployed to /etc/profile.d/etcdctl.sh" (https://github.com/openshift/openshift-docs/pull/11121#discussion_r206508513) @Ge Liu, are 'etcdctl' for etcdctl2 and 'ETCDCTL_API=3 etcdctl' for etcdctl3 standard, or do we need to add a note saying something like: "In the following etcdctl commands, `etcdctl2` is the alias for the v2 API and `etcdctl3` is the alias for the v2 API. Your alias might be different, such as `etcdctl` for the v2 API and 'ETCDCTL_API=3 etcdctl' for the v2 API." @Scott, do you have an opinion?
Here's the functions we define, these should be present on any master and etcd host. # cat /etc/profile.d/etcdctl.sh #!/bin/bash # Sets up handy aliases for etcd, need etcdctl2 and etcdctl3 because # command flags are different between the two. Should work on stand # alone etcd hosts and master + etcd hosts too because we use the peer keys. etcdctl2() { /usr/bin/etcdctl --cert-file /etc/etcd/peer.crt --key-file /etc/etcd/peer.key --ca-file /etc/etcd/ca.crt -C https://`hostname`:2379 ${@} } etcdctl3() { ETCDCTL_API=3 /usr/bin/etcdctl --cert /etc/etcd/peer.crt --key /etc/etcd/peer.key --cacert /etc/etcd/ca.crt --endpoints https://`hostname`:2379 ${@} }
Interesting. When are those functions applied to the host?
@kalexand, the clarification is necessary without scott's PR merged, if etcdctl2 & etcdctl3 are works well after the PR merged, I think the clarification is not necessary, thanks.
There's an engineering PR to fix the root cause of this issue: https://github.com/openshift/openshift-ansible/pull/9385 I'm closing this issue as NOTABUG per Ge Liu's comment.
@kalexand, sorry for this bug could not be closed currently, because it should be used to trace this PR: https://github.com/openshift/openshift-ansible/pull/9385 and the PR also reference to this bug, I changed the owner to @sdodson, pls help to change it to exact component but not current 'Documentation', thanks in advance.
https://github.com/openshift/openshift-ansible/pull/9757 3.10 backport
Verify this bug with openshift-ansible-3.10.41-1.git.0.fd15dd7.el7.noarch.rpm. 1. etcd running as static pod co-located with masters, etcdctl2 & etcdctl3 alias configured on etcd hosts [root@qe-jialiu310z-master-etcd-3 ~]# etcdctl2 cluster-health member 1c648b504ba4936 is healthy: got healthy result from https://10.240.0.69:2379 member 855c261e91cd1b0b is healthy: got healthy result from https://10.240.0.70:2379 member 8fa4e5f628ec1629 is healthy: got healthy result from https://10.240.0.68:2379 cluster is healthy [root@qe-jialiu310z-master-etcd-3 ~]# etcdctl3 member list 1c648b504ba4936, started, qe-jialiu310z-master-etcd-2, https://10.240.0.69:2380, https://10.240.0.69:2379 855c261e91cd1b0b, started, qe-jialiu310z-master-etcd-3, https://10.240.0.70:2380, https://10.240.0.70:2379 8fa4e5f628ec1629, started, qe-jialiu310z-master-etcd-1, https://10.240.0.68:2380, https://10.240.0.68:2379 2. rpm etcd service running on standalone host, etcdctl2 & etcdctl3 alias configured on etcd host [root@ip-172-18-5-224 ~]# etcdctl2 cluster-health member 357f1b12fd37f32c is healthy: got healthy result from https://172.18.5.224:2379 cluster is healthy [root@ip-172-18-5-224 ~]# etcdctl3 member list 357f1b12fd37f32c, started, ip-172-18-5-224.ec2.internal, https://172.18.5.224:2380, https://172.18.5.224:2379
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:2578